fix(cli): filter isMeta and isCompactSummary messages in local and remote mode#359
Merged
tiann merged 2 commits intotiann:mainfrom Mar 24, 2026
Merged
Conversation
…mote mode When Claude Code loads a skill, it injects the full skill content as a user message with isMeta: true. In local mode, this message passes through all existing filters (it's not a summary, not a system message) and reaches the web UI where it renders as a regular chat message. In remote mode, the OutgoingMessageQueue only filtered system-type messages. Skill injections have type 'user' with isMeta: true and slipped through. Also filter isCompactSummary messages at the source for consistency with the web normalizer, which already checks both fields. Changes: - claudeLocalLauncher: add isMeta and isCompactSummary checks - OutgoingMessageQueue: add isMeta and isCompactSummary checks - Add tests for both local launcher (6 tests) and queue (4 tests) Relates to tiann#235
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.
Summary
When Claude Code loads a skill, it injects the full skill content as a user message with
isMeta: true. This message bypasses existing filters in both local and remote mode, causing the full skill text to render as a regular chat message in the web UI.Root cause
Verified by inspecting real JSONL session data — skill injection messages have this structure:
{ "type": "user", "isMeta": true, "message": { "content": [{ "type": "text", "text": "# Full skill content..." }] } }claudeLocalLauncher): only filteredsummaryand invisible system messages —isMetauser messages passed throughOutgoingMessageQueue): only filteredtype === 'system'— skill injections havetype: 'user'and slipped throughAlso adds
isCompactSummaryfiltering at the source for consistency with the web normalizer (normalizeAgent.ts:201-202), which already checks both fields.Changes
claudeLocalLauncher.tsisMetaandisCompactSummarychecks before sendingOutgoingMessageQueue.tsisMetaandisCompactSummarychecks in send filterclaudeLocalLauncher.test.tsOutgoingMessageQueue.test.tsRelates to #235
Test plan
bun run typecheckpasses