feat: content-aware compression nudges with decompression safety net - #28
Merged
ranxianglei merged 1 commit intoJun 28, 2026
Merged
Conversation
Compression nudges now guide WHAT to compress (completed tool outputs, exploration results) instead of just WHEN (threshold). Key changes: Per-message injection (utils.ts + system.ts): - Replace 'Context is ample — do NOT compress' with proactive guidance - 'Keep context lean — compress large shell outputs, diffs, and logs' - 'You can decompress later; nothing is permanently lost' - 'Preserve verbatim: user instructions, decisions, file paths, findings' Turn/context-limit nudges (turn-nudge.ts + context-limit-nudge.ts): - 'compress now' → 'if you've finished reading, compress' - 'CRITICAL MUST NOW' → 'time to compress largest ranges you no longer need' - Both include decompression safety net Per-message block guidance (extensions/nudge.ts): - Add 'When you've finished using tool outputs, compress them' Design rationale: past aggressive nudges caused reckless deletion. Decompression capability makes compression reversible, enabling more proactive compression with lower risk. The old 'ample = don't compress' guidance was causing models to never compress at low context levels, wasting tokens on verbose completed tool outputs. Oracle review: APPROVE_WITH_NITS (both addressed)
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.
Restructures ACP compression nudges from binary threshold-driven to principle-driven (be frugal, compress proactively, decompress later). 5 files, +21/-14 lines. Tested locally for 2 days.