fix(agent): raise default and deep-mode turn budgets#650
Conversation
The default per-run tool-turn budget of 50 was still too low for larger multi-step tasks that span several files: agents hit the ceiling and stopped with a "remaining work" summary instead of finishing. Raise the default from 50 to 80. The "deep" preset also carried MaxTurns: 50, identical to the default, so its "larger turn budget" promise no longer held on the turn-budget axis. Raise it to 160 so deep runs get a genuinely larger budget again. Users can still override per-session with /turns or --max-turns (bounded by MaxTurnsCeiling).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe per-run default tool-turn budget increases from 50 to 80, while the ChangesTurn Budget Defaults
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/modelregistry/modes.go`:
- Line 42: Update the deep mode assertion in the relevant test in exec_test.go
to expect overrides.MaxTurns (gotMaxTurns) to equal 160 instead of 50, matching
the deep preset’s MaxTurns value and applyExecMode behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 073a9baa-fea6-4ad0-a830-aa3988cded9d
📒 Files selected for processing (2)
internal/config/resolver.gointernal/modelregistry/modes.go
Vasanthdev2004
left a comment
There was a problem hiding this comment.
Tiny and clean — just bumping two constants. defaultMaxTurns goes 50 -> 80 and deep-mode MaxTurns 50 -> 160, both still well under the MaxTurnsCeiling=500 clamp, so there's no unbounded-loop risk; the diff is constants-only with no control-flow change, and the exec_test assertion was updated to match. Builds, vet, and gofmt are clean, and the config/modelregistry packages plus the updated cli test all pass (the remaining cli failures are the pre-existing "provider anthropic requires model" noise that reproduces on main). Approving.
Problem
The default per-run tool-turn budget was 50. For larger multi-step tasks that span several files, agents hit the ceiling and stopped mid-task, returning a "remaining work" summary (via the max-turns final-answer prompt) instead of finishing the job. A user hit exactly this on a multi-file feature (cloud sync, WebSocket bridge, QR pairing, PWA endpoint logic, verification): the agent reported "ran out of turns" with a checklist of unfinished items.
Separately, the
deeppreset also carriedMaxTurns: 50, identical to the default. Its description promises "a larger turn budget," but on the turn-budget axis it was no different from a normal run.Fix
defaultMaxTurns: 50 to 80 (internal/config/resolver.go). This is the budget most runs use, including the interactive TUI and plainzero exec, so it is the change that addresses the reported case.deeppresetMaxTurns: 50 to 160 (internal/modelregistry/modes.go), sodeepis a genuine 2x the default again.Both remain overridable per-session with
/turnsor--max-turns, still bounded byMaxTurnsCeiling(500). Precedence is unchanged: an explicit--max-turnsstill wins over a mode preset.Testing
go build ./...go test ./internal/config/... ./internal/modelregistry/...Summary by CodeRabbit
/turns.