Add verbose diagnostics to doctor command with stderr/stdout capture#254
Add verbose diagnostics to doctor command with stderr/stdout capture#254
Conversation
- Add stderr and exit code capture to preflight checks - Add --verbose flag to show detailed stdout/stderr on failure - Include exit code in error messages when non-zero - Show tip about --verbose when doctor fails - Extend AgentPreflightResult type with exitCode, stderr, stdout fields This helps diagnose Windows/Bun installation issues where the agent fails silently without useful error output. Refs: #238 https://claude.ai/code/session_01Wfm5Lc1tQX45EVeKsdEf8w
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe PR adds a verbose mode to the doctor command and extends agent preflight results to include stdout, stderr and exit codes, propagating those diagnostics through preflight execution and human-readable output. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(30,144,255,0.5)
participant User
end
rect rgba(34,139,34,0.5)
participant CLI as Doctor CLI
end
rect rgba(255,165,0,0.5)
participant Agent as BaseAgentPlugin
end
rect rgba(128,0,128,0.5)
participant Proc as External Runner
end
User->>CLI: run `doctor --verbose`
CLI->>Agent: call preflight()
Agent->>Proc: execute minimal test prompt
Proc-->>Agent: return stdout, stderr, exitCode
Agent-->>CLI: AgentPreflightResult { success|failure, stdout, stderr, exitCode }
CLI->>CLI: call printHumanResult(result, verbose=true)
CLI-->>User: print human-readable diagnostics (includes truncated stdout/stderr and exit code)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #254 +/- ##
==========================================
- Coverage 45.51% 45.49% -0.02%
==========================================
Files 91 91
Lines 27378 27442 +64
==========================================
+ Hits 12460 12486 +26
- Misses 14918 14956 +38
🚀 New features to boost your workflow:
|
…uLRKw Add verbose diagnostics to doctor command with stderr/stdout capture
Summary
Enhanced the
doctorcommand with a new--verboseflag that displays captured stderr/stdout output from preflight checks, making it easier to diagnose agent configuration issues.Key Changes
Added
--verbose/-vflag to the doctor command for detailed diagnostic outputExtended
AgentPreflightResulttype to include diagnostic data:exitCode: Exit code from preflight executionstderr: Captured stderr outputstdout: Captured stdout outputEnhanced preflight check execution in
BaseAgentPlugin:Improved error reporting in human-readable output:
--verboseflag is used--verboseflag when doctor fails (unless already in verbose mode)Updated help documentation with new
--verboseoption and example usageImplementation Details
The verbose output is only shown when:
--verboseflag is explicitly passedStderr/stdout output is truncated to 20 lines each to prevent overwhelming output, with a count of remaining lines displayed if truncation occurs. This balances diagnostic usefulness with readability.
https://claude.ai/code/session_01Wfm5Lc1tQX45EVeKsdEf8w
Summary by CodeRabbit
New Features
Improvements