Skip to content

fix(chat): raise turn tool-call limit to 250 - #1789

Merged
dcramer merged 1 commit into
mainfrom
fix/raise-turn-tool-call-limit-250
Sep 7, 2026
Merged

dcramer merged 1 commit into
mainfrom
fix/raise-turn-tool-call-limit-250

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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-96 fired 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.
  • ~241 sampled human-run traces in that window (~1,129 total invoke_agent traces incl. sub-agents), so this is a low but real tax on legitimate work.
  • 30d gen_ai.execute_tool span 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_TURN from 150 to 250 (config + tests only). Left the mechanism (durable cumulativeToolCallCount, 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]

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]>
@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Sep 7, 2026 6:09pm UTC

Request Review

@dcramer
dcramer merged commit 392076a into main Sep 7, 2026
40 checks passed
@dcramer
dcramer deleted the fix/raise-turn-tool-call-limit-250 branch September 7, 2026 18:59

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 07e1ea0f Deployed Sep 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant