Skip to content

fix(cli): name the limit that stopped the demo - #1272

Merged
Birfy merged 2 commits into
mainfrom
agent/1270-demo-stop-cause
Nov 25, 2026
Merged

Birfy merged 2 commits into
mainfrom
agent/1270-demo-stop-cause

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1270

What changed

demo_payload decided the footer from final_reward alone, so AGENTDESCENT_MAX_CALLS=1 agentdescent demo printed "(that is lower than expected for the demo; …)" while the run store it pointed at already recorded stop_reason: budget, stop_detail: max_calls (AGENTDESCENT_MAX_CALLS): 1 call(s) made, cap 1. The payload's note now carries that recorded stop_detail, and both surfaces read it: the human footer prints (the run stopped at max_calls (AGENTDESCENT_MAX_CALLS): 1 call(s) made, cap 1; the run store has the detail: <path>), and demo --json carries the same sentence in note. A run that simply fell short now says the final reward never reached 1.0 instead of blaming the demo.

Reporting only: the run, the cap it enforced, the exit code and the run-store path line are untouched.

Not a goal: the footer's own "next steps" list and any change to what is enforced.

Verification at the tip

Tip SHA: 552dc49
Ran:

  • red first at 441ac2bd, clean tree with only the new test file added, whole file in one run: 2 failed, 2 passed in 2.18s; both failures are the product rows (assert 'max_calls' in out with the footer text, and assert 'max_calls' in 'lower than expected for the demo; see the run store'), and the two passes are the uncapped-run control and the run-store path row, green by design
  • tests/test_demo_capped_footer.py at the tip: 4 passed in 1.95s
  • demo family (test_demo.py, test_demo_temp_root.py, test_demo_learned_library.py, test_demo_dest_link.py, test_demo_learned_rules.py, plus the new file): 64 passed in 33.84s
  • MCP demo rows (tests/test_mcp.py -k demo): 5 passed, 36 deselected in 4.24s
  • python -m tools.changelog_fragments check → 39 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
    Not run:
  • full pytest -q — running at this tip in the background; its line will be posted here as a comment
  • mkdocs build --strict — no file under docs/ or mkdocs.yml changes
  • wheel smoke / real-model check — no packaging or model-adapter change

@HugoXK HugoXK added bug Something isn't working area:cli The agentdescent command line (cli.py, doctor, plan/evolve/status/apply) labels Nov 24, 2026
At main the footer and --json both say the result is lower than expected for
the demo, while the run store records stop_detail: max_calls ... cap 1. The
two product rows fail; the uncapped run and the run-store path line stay green.
demo_payload read only the reward to decide the footer, so a run halted by
AGENTDESCENT_MAX_CALLS printed the fixed sentence about the demo falling
short although the status already recorded which limit fired and what it
observed. The payload now carries that stop_detail as note, and both the
human footer and --json read it; a run that simply fell short keeps a cause
line instead of the stale sentence.
@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Full suite at 552dc49100c67083916455c59116ea6ea065f898 (clean tree, fresh clone of the branch, no network):

21 failed, 8118 passed, 51 skipped, 527 warnings in 2375.50s (0:39:35)

All 21 failures are the four known environment-only files, none of them on this diff's surface: tests/test_sandbox_container.py 12, tests/test_era_srbench.py 6, tests/test_genesis_example.py 2, tests/test_wheel_smoke.py 1. No demo row failed in that run, including the four new rows in tests/test_demo_capped_footer.py.

Body untouched; this comment is the Not run: pointer's conclusion.

@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

QA read at 552dc49100c67083916455c59116ea6ea065f898 (API head read at Date 22:24:13 GMT and 22:28:43 GMT; draft, base 441ac2bd23a248fa56d8da68efc4aaca859e21ad, 3 files +82/−2). Fresh shallow clone of head and base; the head is the tree measured. Body Tip SHA: matches the head.

Checked independently: the capped-demo sentence comes from the run store's recorded stop_detail, not a re-derivation in the footer.

  • Code: demo_payload sets note = f"the run stopped at {rd.status().stop_detail}" for a not-ok run, where rd is the runstore.create(...) record that runstore.execute(rd) updates; there is no max_calls/cap literal in that path, and the old "lower than expected for the demo" string is gone from the footer.
  • End-to-end, AGENTDESCENT_MAX_CALLS=1 demo → rc 1; the footer's last line is the run stopped at max_calls (AGENTDESCENT_MAX_CALLS): 1 call(s) made, cap 1; the run store has the detail: <path>. Reading the record back with runstore.get(...).status() gives stop_reason='budget', stop_detail='max_calls (AGENTDESCENT_MAX_CALLS): 1 call(s) made, cap 1'; the footer contains that exact sentence (string comparison true), the old blame sentence is absent, and the store-path line is present.
  • AGENTDESCENT_MAX_CALLS=3 demo --json → note is exactly the run stopped at max_calls (AGENTDESCENT_MAX_CALLS): 3 call(s) made, cap 3, matching the recorded detail byte-for-byte, so the number follows the record rather than a constant.
  • Uncapped demo --json → rc 0, ok: true, reward 1.0, no note.

Suites:

  • red at base 441ac2bd with only the new file → 2 failed, 2 passed, both failures the product rows with the old sentence
  • new file at the tip → 4 passed in 3.43s
  • demo family → 64 passed in 29.57s
  • tests/test_mcp.py -k demo → 4 passed, 1 skipped, 36 deselected (the body says 5 passed; one row is skipped on this host)
  • changelog_fragments check → 39 changelog fragment(s) OK (38 at base plus the new fragment); gen_api_docs --check → docs/api.md is up to date

No UI surface: CLI text and exit codes only.

No blocking finding at this sha.

Not run: full pytest -q (markdown is not installed here), mkdocs build --strict (no docs change; mkdocs not installed); the body's background full-suite line is its own record, not re-run by me.

No merge action from QA: this report is advisory, the merge gate is the repo's review decision on the head sha, and the merge itself is executed by the repo's merge process.

@HugoXK

HugoXK commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Pre-report — #1272: draft: true → false

Field changed: draft. Reason: the gate set at 552dc49100c67083916455c59116ea6ea065f898 is complete — 10/10 real checks success (deploy / apply labels (live only) skipped, zero failing), mergeable: clean on the single-PR read, QA read 7146283846 posted at this sha with no blocking finding, and the background full-suite run is recorded at the same sha in 7145778686 (21 failures, all four known environment-only files, none on this diff's surface). A ready seat is free.

No push, no rebase, no body edit, no tip move; head stays 552dc49100c67083916455c59116ea6ea065f898.

QA's two non-blocking notes stand as recorded, not as rewrites: the body says 5 passed for tests/test_mcp.py -k demo while QA measured 4 passed, 1 skipped on its host, and the body's full-suite line is its own record rather than a re-run. Fixes #1270 is unchanged.

@HugoXK
HugoXK marked this pull request as ready for review November 25, 2026 04:28
@github-actions github-actions Bot added risk:T2 Risk tier T2 (package code or an unnamed path), set by the controller from the diff agent-pr Pull request opened by an agent labels Nov 25, 2026
@Birfy

Birfy commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Review (Birfy)

Tip SHA: 552dc49
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1272 → T2
  • pytest -q -o addopts='' tests/test_demo_capped_footer.py at this tip → 4 passed
  • git merge-tree --write-tree origin/main pr-1272 → clean (branch is behind main, but the 3-way merge with current main has no conflicts)
  • python -m tools.changelog_fragments check → 39 changelog fragment(s) OK on this branch
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
    Not run:
  • Full offline suite locally — required CI is green on this tip (test 3.9–3.13, build, otel-wire)
    Findings:
  • No actionable defects. A demo stopped by a cap now reads rd.status().stop_detail into both the human footer and --json note, instead of blaming "lower than expected for the demo". An uncapped successful demo still carries no note.
    Verdict: PASS

@Birfy
Birfy merged commit 3c566c4 into main Nov 25, 2026
14 checks passed
@Birfy
Birfy deleted the agent/1270-demo-stop-cause branch November 25, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr Pull request opened by an agent area:cli The agentdescent command line (cli.py, doctor, plan/evolve/status/apply) bug Something isn't working risk:T2 Risk tier T2 (package code or an unnamed path), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

demo: the capped footer blames the demo, not the call cap that stopped it

2 participants