Skip to content

agent status --json - #184

Merged
graywolf336 merged 1 commit into
devfrom
feat/agent-status-json
Sep 3, 2026
Merged

agent status --json#184
graywolf336 merged 1 commit into
devfrom
feat/agent-status-json

Conversation

@graywolf336

Copy link
Copy Markdown
Contributor

atomic agent status had no machine-readable form. Tools that need to decide something — "does this agent have hooks installed, so should I install them before recording a run?" — could only scrape the ✓/○ lines, which are prose.

$ atomic agent status --json
{"agents":[{"name":"claude-code","display_name":"Claude Code","detected":true,"hooks_installed":true},
           {"name":"codex","display_name":"Codex","detected":true,"hooks_installed":false}, ...],
 "sessions":[...], "totals":{"sessions":203,"turns":2,"files_touched":0}}

Shape

  • Every registry agent, sorted by name. Absent ones are listed too — a caller choosing whether to install must tell "Atomic does not know this agent" from "known, and not set up", and an omitted entry cannot say which.
  • Sessions carry what --verbose prints; --verbose is ignored in JSON.
  • sessions_error appears only when the session store cannot be read. The human output prints that and continues; dropping it would make a broken store look like an empty one.

Follows agent lifecycle's existing --json: same flag, serde_json::to_string, snake_case.

Why: Sherpa gates on this. Without the integration installed, an agent's turns are never recorded, so runs complete and the ledger stays empty — a silent gap. Detecting it needs a stable signal.

Checks: cargo fmt --all --check, cargo clippy -- -D warnings, cargo check, and 9 tests in agent::status (4 new) all pass. Verified against a real repo — output matches the text form exactly.

One note: the new tests do not assert that a bare fixture detects nothing. Several agents are configured in $HOME rather than the repository, so that would depend on the machine running the test; they assert the flags agree with the registry instead.

The human output is a report; there was no way to get the same facts as
data. A tool that needs to *decide* something — "does this agent have
hooks installed, and should I install them before recording a run?" —
had to scrape the ✓/○ lines, which are prose and free to change.

Emits every agent in the registry with `detected` and `hooks_installed`,
keyed by the registry's own name. Absent agents are listed too: a caller
choosing whether to install must tell "Atomic does not know this agent"
from "known, and not set up", and an omitted entry cannot say which.
Sorted, so diffing two runs shows real changes only.

Sessions and totals carry the same detail `--verbose` prints, plus
`sessions_error` when the session store cannot be read — the human
output prints that and continues, and dropping it would make a broken
store indistinguishable from an empty one.

Follows `agent lifecycle`'s `--json`: same flag, `serde_json::to_string`,
snake_case fields.
@graywolf336
graywolf336 merged commit 191d91b into dev Sep 3, 2026
8 checks passed
@graywolf336
graywolf336 deleted the feat/agent-status-json branch September 3, 2026 15:11
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.

2 participants