Skip to content

fix(compress): deduplicate protected tool outputs across recompression - #698

Open
s1reyash wants to merge 1 commit into
Tarquinen:devfrom
s1reyash:fix/672-dedupe-protected-tools-recompression
Open

s1reyash wants to merge 1 commit into
Tarquinen:devfrom
s1reyash:fix/672-dedupe-protected-tools-recompression

Conversation

@s1reyash

@s1reyash s1reyash commented Dec 1, 2026

Copy link
Copy Markdown

Fixes #672

Summary

  • In lib/compress/range.ts, run appendMissingBlockSummaries right after injectBlockPlaceholders so all consumed block summaries are present in the summary string before appendProtectedTools inspects it.
  • In lib/compress/protected-content.ts (appendProtectedTools), deduplicate protected tool entries both within the current batch and against the existing summary text (summary.includes(entry)), preventing verbatim re-appending of protected task/subagent outputs on recompression.
  • Add a regression test in tests/compress-range.test.ts verifying a protected task output appears only once after recompressing a block.

Verification

  • npm run format:check
  • npm run typecheck
  • npm run build
  • npm test (125 passed + 8 logger tests passed)
  • npm run check:package

linsaftw added a commit to linsaftw/opencode-dynamic-context-pruning that referenced this pull request Dec 2, 2026
linsaftw added a commit to linsaftw/opencode-dynamic-context-pruning that referenced this pull request Dec 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