Skip to content

fix(cli): --json evolve and --json show drop stop_detail, so the machine output cannot say which cap stopped the run #1190

Closed

Description

@HugoXK

Implementation: AgentDescent (ours) — draft PR #1191 exists; it was opened outside our release order and is being traced, do not pick up.

The run's own machine output cannot say which cap stopped it. status.json and status --json can; the JSON of the command that actually stopped cannot.

What is true today (read at f5017f93)

  • --json evolve builds its payload at cli.py:2763-2770 and never reads st.stop_detail, so it prints "stop_reason": "budget" with no key naming the limit.
  • --json show builds at cli.py:3118-3119 (stop_reason, error) and also drops it.
  • The human line does carry it: _status_line (cli.py:183-188) appends [budget: <detail>], and its own comment says a reader "should not have to open status.json" (feat(run): stop a worker run on max_calls / max_usd with a named stop reason #1166). status.json carries it; tests/test_budget_guard.py:115-124 pins that.
  • stop_detail appears in cli.py only at :83 (comment), :185 and :186 — nothing on the JSON side.

Repro (offline, counting-agent spec, all three from --json evolve)

limit --json evolve status.json
spec max_calls: 6 {"stop_reason": "budget"}, no key max_calls: 6 call(s) made, cap 6
AGENTDESCENT_MAX_CALLS=2 same max_calls (AGENTDESCENT_MAX_CALLS): 2 call(s) made, cap 2
--max-usd 0.01 --usd-per-call 0.5 same max_usd: $0.0000 spent, cap $0.0100

#1181 sharpened the cost: the operator label is now the only thing distinguishing the ceiling from the caller's own flags, and it does not reach this surface.

Acceptance

  • stop_detail appears in both payloads only when it is set, so an uncapped run's payload is byte-identical to today (additive, no schema break);
  • one test row per builder asserting the key's absence without a stop and its presence with the ceiling's label; the absence row is what stops a blanket None from being emitted;
  • no change to stop_reason, to the human line, or to status.json;
  • Partial: #1166 (its acceptance named status.json + status only — this is the gap it left, not drift).

Evidence the PR must carry

  • red-first: the new row raises KeyError: 'stop_detail' on the PR's base, with the failing id and the exact command;
  • green at the tip, same command, plus the touched-file suite;
  • the per-file diff.

Sequencing: the red test and the 8-line fix can be prepared now; the PR opens when a queue slot frees (the Lead says when), so the review seat never holds three AD PRs at once.

Activity

  1. self-assigned this
    on Nov 20, 2026
  2. added
    bugSomething isn't working
    area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 20, 2026
  3. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliThe agentdescent command line (cli.py, doctor, plan/evolve/status/apply)bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions