Skip to content

Commit 4cbf803

Browse files
mydeaclaude
andauthored
ci(auto-fix-issue): Raise turn limit to 80 and tighten prompt (#21001)
## Summary The `auto-fix-issue` workflow was failing with `Reached maximum number of turns (50)` because Claude hit the hard cap before either landing a fix or aborting cleanly. Two changes: - **Raise `--max-turns` from 50 to 80** so larger but still tractable fixes can complete. - **Tighten the prompt** in two ways so we rarely hit the cap: - Add a *Be economic with tool calls* section — plan before acting, batch parallel calls, avoid redundant reads/test runs, stop searching once the answer is found. - Add a *Turn budget* section — if ~50 tool calls in there's no clear path to a small verified fix, stop, comment on the issue with what was tried, and exit instead of grinding into the hard cap. The net effect: fewer wasted turns per run, and when the issue is genuinely too big the action reports a useful issue comment instead of failing with a stack trace. --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3a57997 commit 4cbf803

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/auto-fix-issue.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,20 @@ jobs:
100100
5. Test the fix
101101
6. Checkout a new branch and commit the fix
102102
7. Create a pull request for the fix
103+
104+
Be economic with your turns:
105+
- Your budget is measured in *agent turns* (assistant messages), not individual tool calls. A single turn can contain many parallel tool calls and counts as one turn — so batching is free.
106+
- Plan before acting. Prefer targeted commands over broad ones: read specific line ranges instead of whole files, grep for the exact symbol instead of listing directories.
107+
- In each turn, issue all independent tool calls in parallel rather than spreading them across multiple turns.
108+
- Do NOT re-read a file you just edited to "verify" — the edit either succeeded or errored.
109+
- Do NOT run the full test suite to verify a small fix; run only the directly relevant test file.
110+
- Do NOT re-run linters/formatters/builds repeatedly. Run each at most once unless the code changed since.
111+
- If a search returned what you need, stop searching. Do not look for confirmation.
112+
113+
Turn budget:
114+
- You have a hard limit of 80 agent turns for this entire task. One turn = one assistant message, regardless of how many tool calls it contains. Stay well under the limit.
115+
- If you have used roughly 50 turns and do not yet have a small, verified fix with a clear path to opening a PR, STOP. Do not keep exploring, re-reading files, or retrying tests.
116+
- On stop: post a comment on the issue summarizing the root cause (if known), what you tried, and why you aborted, then exit. Do not open a PR.
117+
- Re-running the same failing command, re-reading the same files, or going in circles is a signal to stop early — do not wait for the budget to run out.
103118
claude_args: |
104-
--max-turns 50
119+
--max-turns 80

0 commit comments

Comments
 (0)