Repository navigation
fix(chat): raise turn tool-call limit to 250 - #1789
Merged
Merged
Conversation
The 150 cap (added in #1752) fired on legitimate long-form human turns, not just runaway automation: 4 hits in 7 days, all human-initiated. Raise the shared cap to 250. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
approved these changes
Sep 7, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MAX_TOOL_CALLS_PER_TURN(added in #1752, shipped 2026-09-01) is a single global cap that fires for both runaway automation and legitimate long-form human turns. This turn hit it: JUNIOR-96,event_id=dbb4dd6a38b64357b739f12e5cdd1499.Evidence
JUNIOR-96fired 4 times in the 7 days since the cap shipped, all on human-initiated turns (app.actor.type:user), none on automated/resource-event turns — the case fix(chat): hard-stop runaway tool loops per turn #1752 targeted.gen_ai.execute_toolspan counts per trace show p90 ≈ 192, p95 ≈ 192, p99 ≈ 256 — 250 sits just under the p99 tail instead of at the p50-adjacent 150.Change
Raise
MAX_TOOL_CALLS_PER_TURNfrom 150 to 250 (config + tests only). Left the mechanism (durablecumulativeToolCallCount, fail-closed behavior) untouched from #1752.Residual risk
Same global cap for automated and human turns — doesn't distinguish runaway CI-watch loops from long-form human work. A follow-up could split limits by actor if this keeps firing.
Requested by David Cramer.
--
View Junior Session [Sentry]