Skip to content

ci(auto-fix-issue): Raise turn limit to 80 and tighten prompt#21001

Open
mydea wants to merge 3 commits into
developfrom
fix/auto-fix-issue-turn-budget
Open

ci(auto-fix-issue): Raise turn limit to 80 and tighten prompt#21001
mydea wants to merge 3 commits into
developfrom
fix/auto-fix-issue-turn-budget

Conversation

@mydea
Copy link
Copy Markdown
Member

@mydea mydea commented May 19, 2026

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.

mydea and others added 2 commits May 19, 2026 13:31
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f5d02f1. Configure here.

Comment thread .github/workflows/auto-fix-issue.yml Outdated
--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) <noreply@anthropic.com>
@mydea mydea requested review from Lms24 and chargome May 19, 2026 12:02
@mydea mydea self-assigned this May 19, 2026
Copy link
Copy Markdown
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

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.

2 participants