Repository navigation
fix(pr-pipeline): note an over-cap done run in its PR and split act-turns counts - #11839
Conversation
…urns counts A run that finishes past its --max-turns is a success to run-claude-cli, so its PR said nothing about the cap. The read runner's lane.json now carries the act-turns step's `turns` beside `max-turns`, and report-outcome adds a Summary line, "The run went past its turn budget (turns=N max-turns=M)", to the PR of a done run whose turns exceed the cap. lane.json is rewritable, so the line only informs and never changes the plan. The act-turns step's logic moves out of both runners' inline scripts into .github/scripts/lib/act-turns.mjs. Each runner copies it from .base before the head checkout, with its SHA-256, and the step loads only bytes that match. act-turns.json now records turn_counts: assistant messages with a null parent_tool_use_id (main loop) and with one set (subagents), each also as distinct model turns by message id, with a note when the file holds main-loop messages only. The 32768-byte cap is unchanged. Refs: #7901 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review (incremental since ef5b122)Scope: No security issues found. The only change since the last review moves one YAML comment block (6 lines). The block describes the issue-mode base checkout and how critical-findings: 0 |
|
claude-review reviewed Incremental review (ef5b122 → 2cc2bdd): no findings. Scope: The change only moves comments. Six comment lines that had ended up above the new Nothing executable changed: step order, |
The act-turns copy step was inserted under the setup-env step's comment in the write runner, so that comment described the wrong step. Refs: #7901 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Post-merge mutation testingKilled 1, survived 5, timeout 0, no coverage 0, invalid 0, not run 1.
Surviving mutants
The run's summary has the full report. |
Refs: #7901
Summary
Two of #7901's criteria, from the 2026-10-31 decision:
donerun that finished past its--max-turnsnow says so in its PR's Summary:The run went past its turn budget (turns=N max-turns=M): the work may be too big for one run.A run within its cap gets no such line.act-turns.jsonnow records how many assistant messages in the execution file belong to the main loop (parent_tool_use_idnull) and how many to subagents (set). That gives the evidence to explain anum_turnsabove the cap, such as 140 of 75.Fix
.github/scripts/lib/act-turns.mjs: the act-turns step's logic, moved out of the inline scripts in both runners.turn_counts:main_loopandsubagentmessage counts, plusmain_loop_turnsandsubagent_turns, which count distinct model turns by message id..basebefore the head checkout and record its SHA-256 as a step output. The act-turns step imports only bytes that match that hash, loading them from adata:URL so the file cannot change between the check and the load.RUNNER_TEMP. In the write runner this step holds the lane token, so a rewritten script must never load.lane.json: addsturnsfrom the act-turns step's existingturnsoutput.report-outcome.mjs:readOverCapreturns{turns, cap}whenturns > max-turns.decidepasses it through, the resumed-branch path included, and adds the Summary line.lane.jsonis rewritable, so the line only informs and never changes the plan.Verification
scripts/check-affected.sh --testson the committed head: 11 static checks passed. It selected 68 test suites and left them to CI, because the workflow files changed. I ran the directly affected suites locally, and all passed:report-outcome.test.mjs: 354 pass.callers.test.mjs,.github/scripts/lib/*.test.mjs,open.test.mjs,seal.test.mjs: 246 pass.scripts/act-turns-denied.test.sh: 63 pass, 0 fail.report-outcome.test.mjs:readOverCapcases. An over-capdonerun returnsopen-prwith theturns=140 max-turns=75line in its Summary. A run within its cap has no line..github/scripts/lib/act-turns.test.mjs: a fixture with both message kinds asserts both counts, plus the main-loop-only note, the worst case under the 32768-byte cap, and redaction.scripts/act-turns-denied.test.sh: runs each runner's step body against the shared script. Added cases: a script that fails the hash fails the step and writes nothing, and the copy step comes before the head checkout.Related
report-lane-outcomeneeds its ownclass=max-turnstext, and "max-turns exhaustion" must come out of its infrastructure-error line. Once a release carries that, everyreport-lane-outcomepin here moves to it.act-turns.jsonfrom one over-cap run and record the main-loop and subagent counts against its cap in fix(pr-pipeline): explain turns above max-turns and report max-turns as a sizing stop #7901.🤖 Generated with Claude Code