Skip to content

feat(pr-review): add optional max_turns input to override turn budget - #13

Merged
Troublor merged 1 commit into
mainfrom
feat/pr-review-max-turns-input
Aug 19, 2026
Merged

feat(pr-review): add optional max_turns input to override turn budget#13
Troublor merged 1 commit into
mainfrom
feat/pr-review-max-turns-input

Conversation

@Troublor

Copy link
Copy Markdown
Collaborator

Summary

Makes the per-invocation turn budget of the claude-pr-review composite action configurable per consumer repo.

Today max_turns is computed entirely inside the action's compose step (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_turns input:

  • Empty (default) → behavior is byte-for-byte unchanged: the existing model-tier / review-depth logic still picks 12 / 44 / 56, and the retry still gets 1.5×.
  • Positive integer → overrides the main analysis pass; the retry keeps its 1.5× headroom relative to the chosen value ((n*3+1)/2).
  • Invalid value (non-integer or 0) → fails the compose step loudly with a clear ::error:: rather than silently disabling the turn cap.

Backward-compatible: existing consumers pass nothing and are unaffected.

Changes

  • action.yml: new max_turns input; wired into the compose step as MAX_TURNS_OVERRIDE, applied after the tier/depth defaults with up-front validation.
  • README.md: document max_turns, and fix stale turn-budget numbers — the README stated 36 for the strong tier in one place and 24/40 for standard/deep in another, both of which disagreed with the action's actual 44/56.

Verification

  • YAML parses (yq lists the new input in the right position); actionlint clean (its "jobs/on missing" notes are the usual false positives from treating a composite action.yml as a workflow).
  • Simulated the compose turn-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, and abc/0 are rejected:
tier depth max_turns result (main / retry)
strong standard (empty) 44 / 66
fast standard (empty) 12 / 18
strong deep (empty) 56 / 84
strong standard 100 100 / 150
fast standard 80 80 / 120
strong deep 30 30 / 45
strong standard abc ❌ step fails
strong standard 0 ❌ step fails
  • The existing actions-test.yml Python unittest suite is unaffected (the change is in the compose shell step, not review_pipeline.py).

🤖 Generated with Claude Code

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
@Troublor
Troublor merged commit 7b8e360 into main Aug 19, 2026
1 check passed
@Troublor
Troublor deleted the feat/pr-review-max-turns-input branch August 19, 2026 08:04
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