fix(compress): Bug 39 — protected tool messages excluded from effectiveMessageIds - #32
Merged
Merged
Conversation
…ds (Bug 39) filterProtectedToolMessages correctly dropped protected tool calls (and their paired results) from directMessageIds, but the result was never written back to effectiveMessageIds. The new block therefore recorded protected messages as covered, hiding them from view and folding them into the block's effective coverage — exactly opencode-acp's Bug 39. Existing tests only asserted on directMessageIds, so the bug was invisible. The README even documented it as a 'Known limitation'. Fix: after filtering, delete the removed ids from the effectiveMessageIds Set so both arrays agree. Add effectiveMessageIds assertions to the two skill-protection tests (verified they fail without the fix). Update README: protected tool messages are now hard-excluded, matching opencode-acp Bug 39. This is no longer a known limitation.
Merged
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.
Problem
Bug 39 (opencode-acp parity): protected tool messages (e.g.
skill,compress) should be hard-excluded from compression. The README documented this as a "Known limitation" — but it was a real bug, not a deliberate simplification.filterProtectedToolMessages(compress.ts:686) correctly drops protected tool calls and their paired results fromdirectMessageIds. But the result was never written back toeffectiveMessageIds. The new block therefore recorded protected messages as covered:Consequences:
Why it was invisible
Existing tests (
protected-content.test.ts) only asserted ondirectMessageIds— nevereffectiveMessageIds. So the bug passed all 211 tests.Fix
compress.ts: after
filterProtectedToolMessages, delete removed ids from theeffectiveMessageIdsSet so both arrays agree:Tests
Added
effectiveMessageIdsassertions to the two skill-protection tests. Verified they fail without the fix (2 failures) and pass with it.README
Replaced the "Known limitation" note — protected tool messages are now hard-excluded, matching opencode-acp Bug 39.
Test plan