Release: hard-prune post-compression tool context (#5667) - #5852
Merged
Merged
Conversation
WebUI hard token-cap on protected-tail tool-result payloads in the MODEL CONTEXT only, applied once after a confirmed compression event, to prevent post-compression context blowup. Deep-copy content-replace only (no message removal/reorder → no orphaned tool_result); visible transcript (s.messages) untouched. Deep-review re-gate: Codex SAFE (pairing-safety + context-only + idempotent verified by reproduction), 65 own + 992 regression tests green. Crown-jewel streaming path. Co-authored-by: franksong2702 <franksong2702@users.noreply.github.com>
Contributor
|
| Filename | Overview |
|---|---|
| api/streaming.py | Adds model-context-only hard pruning after compression and filters generated summaries out of display merges. |
| tests/test_auto_compression_card.py | Adds focused tests for pruning behavior, idempotency, private flag handling, and transcript preservation. |
| CHANGELOG.md | Adds the release note for the compressed-context tool-result cap. |
Reviews (1): Last reviewed commit: "Release: hard-prune post-compression too..." | Re-trigger Greptile
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.
Ships #5667 (@franksong2702) — hard-prune post-compression tool context (#4685).
What
After a compression event, the protected-tail tool-result payloads in the model context are hard-capped to a token budget (applied once, post-compression only), preventing context blowup.
Gate (deep-review re-gate on live head 1350182)
contenton a deep copy only, never removes/reorders → everytool_call↔tool_result ID preserved through prune + API sanitization.s.context_messages;s.messages(visible transcript) retains full tool output (shared-object probe).Closes #5667.