Skip to content

feat: content-aware compression nudges with decompression safety net - #28

Merged
ranxianglei merged 1 commit into
masterfrom
ranxianglei/2026-06-28_nudge-text-content-aware
Jun 28, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
ranxianglei/2026-06-28_nudge-text-content-aware

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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.

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)
@ranxianglei
ranxianglei merged commit 059f45e into master Jun 28, 2026
2 checks passed
@ranxianglei
ranxianglei deleted the ranxianglei/2026-06-28_nudge-text-content-aware branch June 28, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant