Skip to content

fix: raise the PR review turn cap from 60 to 120 - #625

Merged
johanzander merged 1 commit into
mainfrom
fix/review-turn-cap
Aug 17, 2026
Merged

fix: raise the PR review turn cap from 60 to 120#625
johanzander merged 1 commit into
mainfrom
fix/review-turn-cap

Conversation

@johanzander

Copy link
Copy Markdown
Owner

The reviewer was not slow — it was dead

On PR #623 the Stage 4 run ended:

##[error]Execution failed: Reached maximum number of turns (60)

It had posted only an early scratch comment (test-permission-check (will be replaced)) and never got back to replacing it. So the PR sat for 16 minutes showing a stray review and no verdict, while the run had already failed. A caller waiting on a verdict cannot distinguish a dead run from a thinking one — both are silence — so scripts/request-pr-review.sh waits out its full timeout for nothing.

This is not the first time it looked like flakiness. #619's two "silent" rounds and #623's stub round were all read as bot noise; at least this one was a hard failure with a clear cause in the log.

Why the cap is reached

Because the reviewer earns its keep. On the previous #623 round it:

  • checked the branch out and ran pytest (27 passed),
  • reverted the fix and re-ran the suite to confirm 13 tests go red without it — the "must be seen to fail" rule from docs/agents/testing.md,
  • ran black --check, ruff, mypy and shellcheck,
  • and independently verified a claim in the PR body against a real repo.

That is exactly the behaviour worth paying for, and its turn cost scales with the diff. 60 is fine for a one-file fix and not for a multi-file one.

120 leaves headroom while still bounding a runaway.

Why this is a one-line PR

Workflows triggered by issue_comment run from the default branch, so this has no effect on any review until it is on main. Every other open PR is queued behind it — including the two that carry the rest of the Product Owner loop.

Worth noting while merging: branch protection on main requires only the Merge gate status check (required_pull_request_reviews: null), so this does not need a bot approval to land.

🤖 Generated with Claude Code

The Stage 4 reviewer ran out of turns instead of reviewing. On PR #623 the run
ended with `Execution failed: Reached maximum number of turns (60)` after
posting only an early scratch comment, so the PR carried a stray review and no
verdict while the run was already dead. Waiting 16 minutes looked like a slow
review and was a failed one -- and scripts/request-pr-review.sh cannot tell
those apart, because a dead run and a thinking one are both silence.

The cap is hit because this reviewer does real verification: it checks the
branch out, runs the suite, REVERTS the fix to confirm the tests go red without
it, then runs black/ruff/mypy/shellcheck. That is the behaviour worth paying
for, and its cost scales with the diff. 120 leaves headroom for a multi-file PR
while still bounding a runaway.

Deliberately a one-line PR so it can be merged on its own: workflows triggered
by `issue_comment` run from the DEFAULT branch, so this has no effect on any
review until it is on main. Every other open PR is waiting behind it.
@johanzander
johanzander merged commit 3d964fa into main Aug 17, 2026
8 checks passed
@johanzander
johanzander deleted the fix/review-turn-cap branch August 17, 2026 12:10
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