From aba9e7cecc094abf3391ecbbd854bec208a50ab9 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Tue, 19 May 2026 13:31:03 +0200 Subject: [PATCH 1/3] ci(auto-fix-issue): Raise turn limit to 80 and add abort budget Bumps `--max-turns` from 50 to 80 and adds explicit turn-budget guidance to the prompt so Claude aborts and posts a comment well before hitting the hard cap, instead of failing the action with "Reached maximum number of turns". Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/auto-fix-issue.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-fix-issue.yml b/.github/workflows/auto-fix-issue.yml index 9e46ff1a0296..50648f497dbf 100644 --- a/.github/workflows/auto-fix-issue.yml +++ b/.github/workflows/auto-fix-issue.yml @@ -100,5 +100,11 @@ jobs: 5. Test the fix 6. Checkout a new branch and commit the fix 7. Create a pull request for the fix + + Turn budget: + - You have a hard limit of 80 tool calls for this entire task. Stay well under it. + - If you have used roughly 50 tool calls 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. + - 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. + - 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. claude_args: | - --max-turns 50 + --max-turns 80 From f5d02f1f958c7ceaeb259986fa0b657316666ea4 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Tue, 19 May 2026 13:31:33 +0200 Subject: [PATCH 2/3] ci(auto-fix-issue): Add economy guidance for tool call usage Adds explicit guidance to the auto-fix prompt to plan before acting, batch parallel tool calls, avoid redundant reads/test runs, and stop searching once an answer is found. Complements the 80-turn budget by reducing the chance of running into it in the first place. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/auto-fix-issue.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/auto-fix-issue.yml b/.github/workflows/auto-fix-issue.yml index 50648f497dbf..e0314d449c4d 100644 --- a/.github/workflows/auto-fix-issue.yml +++ b/.github/workflows/auto-fix-issue.yml @@ -101,6 +101,15 @@ jobs: 6. Checkout a new branch and commit the fix 7. Create a pull request for the fix + Be economic with tool calls: + - Every tool call (Bash, Read, Grep, Edit, etc.) counts against your budget. 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. + - Batch independent operations into a single message with parallel tool calls. + - Do NOT re-read a file you just edited to "verify" — the edit either succeeded or errored. + - Do NOT run the full test suite to verify a small fix; run only the directly relevant test file. + - Do NOT re-run linters/formatters/builds repeatedly. Run each at most once unless the code changed since. + - If a search returned what you need, stop searching. Do not look for confirmation. + Turn budget: - You have a hard limit of 80 tool calls for this entire task. Stay well under it. - If you have used roughly 50 tool calls 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. From 61ae6f45474516b087d6c7d19da187ddab3a20a0 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Tue, 19 May 2026 13:58:13 +0200 Subject: [PATCH 3/3] ci(auto-fix-issue): Phrase budget in turns, not tool calls --max-turns counts agent turns (assistant messages), not individual tool calls. A single turn can contain many parallel tool calls and counts as one. Rephrasing the budget and economy guidance to match, so Claude self-regulates against the correct unit and is not penalized for the batching the same prompt encourages. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/auto-fix-issue.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-fix-issue.yml b/.github/workflows/auto-fix-issue.yml index e0314d449c4d..d05deb3f9568 100644 --- a/.github/workflows/auto-fix-issue.yml +++ b/.github/workflows/auto-fix-issue.yml @@ -101,18 +101,18 @@ jobs: 6. Checkout a new branch and commit the fix 7. Create a pull request for the fix - Be economic with tool calls: - - Every tool call (Bash, Read, Grep, Edit, etc.) counts against your budget. 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. - - Batch independent operations into a single message with parallel tool calls. + Be economic with your turns: + - 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. + - 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. + - In each turn, issue all independent tool calls in parallel rather than spreading them across multiple turns. - Do NOT re-read a file you just edited to "verify" — the edit either succeeded or errored. - Do NOT run the full test suite to verify a small fix; run only the directly relevant test file. - Do NOT re-run linters/formatters/builds repeatedly. Run each at most once unless the code changed since. - If a search returned what you need, stop searching. Do not look for confirmation. Turn budget: - - You have a hard limit of 80 tool calls for this entire task. Stay well under it. - - If you have used roughly 50 tool calls 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. + - 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. + - 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. - 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. - 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. claude_args: |