Skip to content

Add --verbose debug level with validation diagnostics#193

Open
lilly-luo wants to merge 3 commits into
mainfrom
lilly/more-debug
Open

Add --verbose debug level with validation diagnostics#193
lilly-luo wants to merge 3 commits into
mainfrom
lilly/more-debug

Conversation

@lilly-luo

@lilly-luo lilly-luo commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a new debug verbosity level that surfaces step-level detail during the post-configure validation step, so it's clear what validation is doing, why it's slow, and why it's failing.

Behavior (--verbose debug)

For each tool being validated, ucode now prints:

  • running: <command> — the exact validation command executed
  • env: <keys> — the env vars ucode injects (keys only, never token values)
  • timeout: 60s — so you know when/why it gives up
  • exited with code N in X.Xs — return code + elapsed time (why it's slow)
  • raw output: + full subprocess output on failure (why it's failing)

Timeouts and launch (OSError) failures also print elapsed time and the reason. The spinner is skipped in debug mode so these per-step lines aren't clobbered by the animation; a plain Validating <Tool>... header is printed instead.

The existing --verbose levels (normal, low) are unchanged.

Files changed

  • src/ucode/ui.py — added is_debug_verbosity() and a print_debug() helper that only emits at debug.
  • src/ucode/agents/__init__.pyvalidate_tool() emits the diagnostics; validate_all_tools() prints a plain header instead of a spinner in debug mode.
  • src/ucode/cli.py--verbose accepts debug (validation + help updated); added _validate_single_tool() so the single-agent path gets the same behavior.
  • tests/test_agents_init.py — tests for debug per-tool headers and validate_tool diagnostics (success timing, failure raw output, silence at normal verbosity).

Testing

$ uv run ucode codex --verbose debug
(Optional) Update Codex from 0.143.0-alpha.14 to 0.143.0-alpha.32? (y/n) › n
✔ Databricks auth already available for https://dbc-a5d4177a-49dc.cloud.databricks.com
✔ Unity AI Gateway detected      
╭───────────────── Configuration Complete ──────────────────╮
│ Workspace: https://dbc-a5d4177a-49dc.cloud.databricks.com │
│ Codex: configured (Provider: Databricks)                  │
╰───────────────────────────────────────────────────────────╯
Validating Codex...
  ↳ running: codex --profile ucode exec --skip-git-repo-check Respond with a greeting in five words or fewer.
  ↳ timeout: 60s
  ↳ exited with code 0 in 12.5s

lilly-luo added 3 commits July 8, 2026 18:39
Introduce a new "debug" verbosity level that surfaces step-level detail
during the post-configure validation step, so users can see what
validation is doing, why it's slow, and why it's failing.

With --verbose debug, validate_tool now prints the command being run,
the env keys ucode injects (keys only, never token values), the timeout,
the exit code and elapsed time, and — on failure — the raw subprocess
output. The spinner is skipped in debug mode so these per-step lines
aren't clobbered by the animation.

Co-authored-by: Isaac
--verbose debug previously only worked on `ucode configure`, but validation
also runs on the launch path (ucode codex/claude/...). The launch commands
didn't define --verbose and use ignore_unknown_options, so the flag was
forwarded verbatim to the agent — the agent saw `debug` as its first
positional (prompt) argument.

Add a shared --verbose option to all six launch commands, consumed by ucode
(via _launch_tool → set_verbosity) before auto-configure/validation runs, so
`--verbose debug` surfaces validation diagnostics where the validation
actually happens. Like --provider, --verbose is now a ucode-level launch flag;
pass agent flags after `--` (e.g. `ucode codex -- --verbose`).

Extract _validate_verbose() shared with the configure callback.

Co-authored-by: Isaac
"say hi in 5 words or less" is now sent to public gateways during validation.
Reword to "Respond with a greeting in five words or fewer." — same terseness
and word cap (keeps validation fast), but grammatical and professional.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant