Skip to content

feat(protected): exclude read/bash from recent-zone - #35

Merged
ranxianglei merged 1 commit into
masterfrom
2026-08-02_never-preserve-read-bash
Aug 2, 2026
Merged

feat(protected): exclude read/bash from recent-zone#35
ranxianglei merged 1 commit into
masterfrom
2026-08-02_never-preserve-read-bash

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Why

read (file/image contents) and bash (build/test/log output) are the largest common sources of tool-result context bloat. When such results land in the preserveRecentMessages last-N window they become un-compressible — the model cannot reclaim that context, and they never appear in compressible-ranges recommendations.

Change

Add read and bash to NEVER_PRESERVE_RECENT_TOOLS (alongside decompress and search_context).

They remain fully visible and compressible like any ordinary message — this only removes them from the soft-protected recent zone, so the protected window covers actual conversation turns (user intent, assistant reasoning, tool dispatch decisions) instead of being filled by spent file/command output.

Verification

  • typecheck ✅
  • test ✅ 208 pass / 0 fail (no test asserts the list contents or depends on read/bash being in the recent zone)
  • No behavior change for compress/protectedTools (always-protected) — only the soft recent-zone is affected.

read (file/image contents) and bash (build/test/log output) are the largest
common sources of tool-result context bloat. When such results land in the
preserveRecentMessages last-N window they become un-compressible — the model
cannot reclaim that context, and they never appear in compressible-ranges
recommendations.

Add read/bash to NEVER_PRESERVE_RECENT_TOOLS (alongside decompress and
search_context). They remain fully visible and compressible like any
ordinary message — this only removes them from the soft-protected recent
zone, so the protected window covers actual conversation turns (user intent,
assistant reasoning, tool dispatch decisions) instead of being filled by
spent file/command output.
@ranxianglei
ranxianglei merged commit bd91881 into master Aug 2, 2026
3 checks passed
@ranxianglei ranxianglei mentioned this pull request Aug 2, 2026
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