ci(claude-review): raise --max-turns 20 -> 50#3692
Merged
Conversation
The Claude Code Review action runs /code-review:code-review with a hard --max-turns cap. On large PRs (e.g. #3636 "add stm32c5 support", 29 files / +1689), the agent exhausts 20 turns exploring the diff before it can produce and post its review, so the SDK returns an error and the claude-review check fails red with: Reached maximum number of turns (20) Raise the cap to 50 so port-sized PRs complete and post their review. Cost scales with tokens, not the cap: a finished review pays the same whether the ceiling is 25 or 50 — the cap only bites when the agent would otherwise be force-stopped mid-run. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Claude Code Review GitHub Actions workflow configuration to allow the review agent to run longer before being force-stopped, addressing failures on larger pull requests where the agent previously hit the turn limit before posting results.
Changes:
- Increase
claude_argsturn cap from--max-turns 20to--max-turns 50in theclaude-reviewworkflow job.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Raise the Claude Code Review action's turn cap from
--max-turns 20to--max-turns 50in.github/workflows/claude-code-review.yml.Why
The
claude-reviewworkflow runs/code-review:code-review … --commentwith a hard--max-turnslimit. On large PRs the agent spends all its turns reading the diff and source files and never reaches its final "post the review" step, so the SDK returns an error and the check fails red:This is what happened on #3636 ("add stm32c5 support" — 29 files, +1689/−15): every build check was green, but
claude-reviewdied at 20 turns and posted nothing.Cost note
Cost scales with tokens, not the turn cap. A review that finishes in 25 turns costs the same whether the ceiling is 25 or 50 — the cap only bites when the agent would otherwise be force-stopped mid-run. Bumping it to 50 just lets port-sized PRs complete; the typical small PR is unaffected.
Not in scope
The
show_full_output: trueline above it is still markedTEMPORARYfor debugging — left untouched here.🤖 Generated with Claude Code