Skip to content

doctor: report every agent, not just Codex - #364

Merged
zzet merged 1 commit into
mainfrom
fix/doctor-report-every-agent
Jul 27, 2026
Merged

doctor: report every agent, not just Codex#364
zzet merged 1 commit into
mainfrom
fix/doctor-report-every-agent

Conversation

@zzet

@zzet zzet commented Jul 27, 2026

Copy link
Copy Markdown
Owner

The runtime half of doctor described one agent. The invocation log has been partitioned per agent since it learned to record one, and the finding rules take the agent as a parameter — only the collection and the rendering singled Codex out. So a machine running Claude Code got a detailed report about the agent it uses less and nothing about the one it uses most.

Doctor now walks a list of agents, each contributing install state, its own slice of the hook log, adoption from its own transcripts, and its own findings, tagged so a reader can tell whose is whose. Adding an agent is now the cost of one probe entry; the rules, the log partition, and the renderer are already generic.

Claude Code gains the two readers Codex already had. Inspect covers the hooks in settings.local.json, the MCP stanza in ~/.claude.json, and the rule block in ~/.claude/CLAUDE.md, reusing this package's own path helpers so a file the adapter writes and a file the reporter looks for cannot drift. The transcript scanner reads assistant messages' tool_use parts; a native Read/Grep/Glob counts in the same denominator as a shell read, because it is the same competing behaviour.

Only Codex carries the trust gate, so only Codex gets the /hooks remedy — the rules already handled that distinction, it just had no second agent to prove it against.

Why this is a separate PR

This commit was pushed to fix/doctor-mixed-attribution-and-redact about thirty minutes after #353 had already merged. A merged PR does not reopen on a push to its head branch, so the change was never proposed anywhere and never reached main. Cherry-picked here onto current main, unchanged — identical patch-id to the original.

Verification

go vet and go test pass for both touched packages:

ok  github.com/zzet/gortex/internal/agents/claudecode  0.904s
ok  github.com/zzet/gortex/internal/doctor             0.297s

The runtime half described one agent. The invocation log has been
partitioned per agent since it learned to record one, and the finding
rules take the agent as a parameter — only the collection and the
rendering singled Codex out. So a machine running Claude Code got a
detailed report about the agent it uses less and nothing about the one
it uses most.

Doctor now walks a list of agents, each contributing install state, its
own slice of the hook log, adoption from its own transcripts, and its
own findings, tagged so a reader can tell whose is whose. Adding an
agent is now the cost of one probe entry; the rules, the log partition,
and the renderer are already generic.

Claude Code gains the two readers Codex already had. Inspect covers the
hooks in settings.local.json, the MCP stanza in ~/.claude.json, and the
rule block in ~/.claude/CLAUDE.md, reusing this package's own path
helpers so a file the adapter writes and a file the reporter looks for
cannot drift. The transcript scanner reads assistant messages'
tool_use parts; a native Read/Grep/Glob counts in the same denominator
as a shell read, because it is the same competing behaviour.

Only Codex carries the trust gate, so only Codex gets the /hooks
remedy — the rules already handled that distinction, it just had no
second agent to prove it against.
@zzet
zzet merged commit 551a25b into main Jul 27, 2026
12 checks passed
@zzet
zzet deleted the fix/doctor-report-every-agent branch July 28, 2026 08:14
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