You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dedbbaf
Browse filesBrowse the repository at this point in the historyBrowse files
[AI] fix(agents): align TOOL_RESULT_CHARS_PER_TOKEN with ESTIMATED_CHARS_PER_TOKEN
Change TOOL_RESULT_CHARS_PER_TOKEN from 2 to 4 so that tool-result text is
estimated at the same chars-per-token ratio as ordinary text. The old value
of 2 caused the mid-turn precheck to over-estimate tool-result token
pressure by ~2x, triggering destructive truncate_tool_results_only recovery
on turns well within the real context window.
Updated affected test thresholds to match the corrected estimates and
added a regression test for the reporter's scenario: ~250k chars of
tool-result text across ~20 calls on a 200k context window with 50k
reserve tokens should no longer false-positive overflow.
Co-Authored-By: Claude <[email protected]>
Related to #101929
0 commit comments