Add --verbose debug level with validation diagnostics#193
Open
lilly-luo wants to merge 3 commits into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
debugverbosity 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 executedenv: <keys>— the env vars ucode injects (keys only, never token values)timeout: 60s— so you know when/why it gives upexited 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 plainValidating <Tool>...header is printed instead.The existing
--verboselevels (normal,low) are unchanged.Files changed
src/ucode/ui.py— addedis_debug_verbosity()and aprint_debug()helper that only emits atdebug.src/ucode/agents/__init__.py—validate_tool()emits the diagnostics;validate_all_tools()prints a plain header instead of a spinner in debug mode.src/ucode/cli.py—--verboseacceptsdebug(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 andvalidate_tooldiagnostics (success timing, failure raw output, silence at normal verbosity).Testing