Repository navigation
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been 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.
Problem and change
Closes #3843. An arbitrary tool result can exceed the complete request budget even when normal result eviction is disabled, the tool is excluded, storage fails, or the output is below the ordinary eviction threshold. The next request then fails, and the retained oversized result can obstruct continuation.
Add deterministic output reduction at the final model boundary, before either reasoning or summarization. Preserve tool-call identity/state/metadata, archive full output blocks as JSON when possible, and disclose unavailable content when storage cannot preserve it. Commit the bounded canonical history only after final validation. On a provider context rejection, attempt a reduced tool-result view and retry once in both native and legacy session modes. If forced summarization is needed, retain the current user turn and tool exchanges. No tool is rerun by recovery.
This complements read_file pagination in #3821; it does not depend on tools implementing their own size limits. EN/ZH context documentation describes the behavior and limits.
Validation
7653eb7e: all 10 new regression scenarios fail.clean verifywas attempted: Core ran 2,857 tests with 0 assertion failures, 2 errors and 9 skipped. The two errors are unchanged DangerousPathBypassTest symlink fixtures denied by Windows privileges; downstream modules skipped by this reactor are not claimed as verified. The separate Harness suite above passed.Boundaries
Storage failure causes an explicit lossy fallback. Fixed prompts, user input, schemas or irreducible metadata can still exceed the model budget. One provider retry cannot guarantee recovery for arbitrary tokenizers or unknown limits. This does not cap allocations inside tools, migrate legacy sessions, or claim live-provider validation.