feat(pr-review): add optional max_turns input to override turn budget - #13
Merged
Conversation
The claude-pr-review composite action derived its per-invocation turn budget (12 fast / 44 standard / 56 deep) entirely internally, so a consumer repo could not tune the analysis ceiling without editing the centralized action. Add an optional `max_turns` input: empty (default) preserves the existing tier/depth-derived budget exactly, and a positive integer overrides it for the main analysis pass while the retry keeps its 1.5x headroom relative to the chosen value. A non-integer or non-positive value fails the compose step loudly rather than silently disabling the cap. Also correct the README's turn-budget numbers, which had drifted from the action (it stated 36 for strong and, separately, 24/40 for standard/deep, while the action uses 44 and 56). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GCc8MLBBAp5jAxc2x19swa
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.
Summary
Makes the per-invocation turn budget of the
claude-pr-reviewcomposite action configurable per consumer repo.Today
max_turnsis computed entirely inside the action'scomposestep (12 fast / 44 standard / 56 deep) and is not exposed as an input, so a consuming repo can't raise or lower the analysis ceiling without editing the centralized action (which ships to every consumer at once).This adds an optional
max_turnsinput:(n*3+1)/2).0) → fails thecomposestep loudly with a clear::error::rather than silently disabling the turn cap.Backward-compatible: existing consumers pass nothing and are unaffected.
Changes
action.yml: newmax_turnsinput; wired into thecomposestep asMAX_TURNS_OVERRIDE, applied after the tier/depth defaults with up-front validation.README.md: documentmax_turns, and fix stale turn-budget numbers — the README stated36for the strong tier in one place and24/40for standard/deep in another, both of which disagreed with the action's actual44/56.Verification
yqlists the new input in the right position);actionlintclean (its "jobs/on missing" notes are the usual false positives from treating a compositeaction.ymlas a workflow).composeturn-budget logic across all branches — defaults reproduce today's exact values (44/66, 12/18, 56/84), overrides win over both fast tier and deep depth, andabc/0are rejected:max_turns1008030abc0actions-test.ymlPython unittest suite is unaffected (the change is in the compose shell step, notreview_pipeline.py).🤖 Generated with Claude Code