ci(claude-review): raise max-turns to 80, make review non-blocking - #65
ci(claude-review): raise max-turns to 80, make review non-blocking#65giancolombi wants to merge 1 commit into
Conversation
Greptile SummaryThis PR fixes the Claude Code Review action failing on non-trivial PRs by raising
Confidence Score: 5/5Safe to merge — the change is scoped entirely to CI configuration and makes the review step non-blocking without removing any visibility into failures. The three guards (higher turn budget, step-scoped timeout, continue-on-error) are well-reasoned and correctly ordered. The 25-min job ceiling sits above the 20-min step ceiling, preventing the outer timeout from ever firing during a normal review. No application logic is touched. No files require special attention. The only substantive change is in Important Files Changed
Reviews (2): Last reviewed commit: "ci(claude-review): raise max-turns to 80..." | Re-trigger Greptile |
The Claude Code Review action fails on non-trivial PRs with:
"subtype": "error_max_turns", "num_turns": 31
error: Claude Code returned an error result: Reached maximum number of turns (30)
##[error]Process completed with exit code 1.
The review reads the diff + CLAUDE.md + the changed files and posts one
inline comment per finding, so a larger PR exhausts the 30-turn budget
before it can finish — the SDK returns error_max_turns and
claude-code-action surfaces it as a hard failure, red-X-ing the PR.
The review is advisory and must never block a PR:
1. --max-turns 30 -> 80: comfortable headroom over what a large review
needs. Normal runs finish well under 30, so cost is unchanged.
2. Two-tier timeout. timeout-minutes: 20 on the claude STEP is the primary
bound — a step timeout is a step failure that continue-on-error swallows,
so even a maxed-out review stays green (a job-level timeout would cancel
the whole job and red-X it regardless). A job-level timeout-minutes: 25
stays ABOVE the step bound as an outer net for a hang in another step
(e.g. checkout), so it never fires on a normal long review.
3. continue-on-error: true: a max-turns exhaustion, the step timeout, or a
transient API error all leave the posted inline comments + the
track_progress sticky comment in place and the check stays green.
Part of an org-wide rollout; canonical change: prodcycle/prodcycle#1554.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5fdc980 to
604b9ed
Compare
Problem
The Claude Code Review action has been failing across the org on non-trivial PRs:
Root cause
The review reads the diff +
CLAUDE.md+ the changed files and posts one inline comment per finding, so each read/finding is its own turn. On a larger PR the reviewer exhausts the--max-turns 30budget before it can finish; the SDK returnserror_max_turnsandclaude-code-actionsurfaces that as a hard failure (exit code 1) → a red X on the PR, even though the review is advisory.Fix (three guards, all at the step level so
continue-on-erroractually covers them)--max-turns 30 → 80— comfortable headroom over what a large review needs. Normal runs already finish well under 30, so cost is unchanged.timeout-minutesmoved from the job to the claude step — a job-level timeout cancels the whole job and red-Xes the PR regardless ofcontinue-on-error; a step-level timeout is a step failure thatcontinue-on-errorcan swallow. 20 min stays the wall-clock/cost bound.continue-on-error: true— a max-turns exhaustion, the step timeout, or a transient API error all leave the posted inline comments + thetrack_progresssticky comment in place and the check stays green. The sticky comment still surfaces any error, so failures stay visible without blocking.Context
This workflow is byte-identical across 10 org repos; this PR is part of an org-wide rollout. Canonical change & rationale: prodcycle/prodcycle#1554.
🤖 Generated with Claude Code