Conversation
📝 WalkthroughWalkthroughThe registry now detects CLI agents by binary presence on ChangesPresence Detection and Doctor Reporting
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Doctor
participant DefaultHosts
participant DetectPresent
participant PATH
Doctor->>DefaultHosts: Build default hosts
DefaultHosts->>DetectPresent: Detect CLI agents
DetectPresent->>PATH: Check agent binaries
PATH-->>DetectPresent: Return present binaries
DetectPresent-->>DefaultHosts: Return agent IDs
DefaultHosts-->>Doctor: Return hosts for reporting
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Group text output by host (X/Y ok), show detail lines only for failing checks and stale rules, and add an overall pass count. JSON output is unchanged. Agentflare-Agent: claude-code_2-1-225_agent Agentflare-Branch: task/429 Agentflare-Item: 429
default_hosts() called agent_registry::detect_all(), which spawns a --version subprocess per detected agent to populate DetectedAgent.version — doctor only ever read .id. On Windows, Node-wrapped CLI agents (opencode, github-copilot-cli) each cost 500ms+ per --version spawn, sequential across every detected host: ~1.76s of doctor's ~3.6s runtime came from output nobody looked at. Add agent_registry::detect::detect_present() — PATH presence only, no subprocess — and switch default_hosts() to it. Fix the identical pattern in components.rs::detected_skill_agents(), whose own comment already said it only needs agent IDs. Also memoize the doctor githooks/mise/leanctx checks (each spawns git/where) so they run once instead of once per host. agentflare doctor: ~3.6s -> ~365ms, output unchanged. Agentflare-Agent: claude-code_2-1-225_agent Agentflare-Branch: task/429 Agentflare-Item: 429
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.
Summary
agentflare doctor's text output dumped every check (ok + missing) across every host, repeating the fulldescribeboilerplate — now grouped per host (X/Y ok), with detail lines only for failures/stale rules, plus an overall pass count.--jsonoutput is unchanged.default_hosts()calledagent_registry::detect_all(), which spawns a--versionsubprocess per detected agent CLI — a valuedoctornever reads (only.id). On Windows, Node-wrapped CLIs (opencode, github-copilot-cli) cost 500ms+ per spawn, sequential: ~1.76s of doctor's ~3.6s runtime was output nobody looked at.agent_registry::detect::detect_present()— PATH presence only, no subprocess — and switcheddefault_hosts()to it. Fixed the identical latent bug incomponents.rs::detected_skill_agents()(its own comment already said it only needs agent IDs).githooks/mise/leanctxchecks (each spawnsgit/where) so they run once instead of once per host.Result:
agentflare doctor~3.6s → ~365ms (~9-10x), output unchanged.Test plan
cargo build --bin agentflarecargo nextest run --workspace -E 'test(doctor::) or test(components::) or package(agentflare-agent-registry)'— 89/89 passedagentflare doctor/agentflare doctor --jsonrun — output verified identical to before, just fasterSummary by CodeRabbit