fix(parser): surface task-notification wrapped in system-reminder (v2.1.234+) - #264
Open
delexw wants to merge 1 commit into
Open
fix(parser): surface task-notification wrapped in system-reminder (v2.1.234+)#264delexw wants to merge 1 commit into
delexw wants to merge 1 commit into
Conversation
….1.234+) Claude Code v2.1.234 delivers between-turn background-task notifications fully wrapped in <system-reminder> tags, matching mid-turn delivery. is_user_noise() treated any entry starting and ending with <system-reminder> as pure noise and dropped it, silently losing the wrapped <task-notification>'s completed/failed/killed status instead of surfacing the informational System message it produced when unwrapped. Add unwrap_system_reminder() and use it in both is_user_noise() and the TASK_NOTIFICATION_TAG dispatch so a wrapped task-notification still classifies as a System message with the correct is_error status. Plain reminders with no task-notification inside are still dropped as before. Fixes #262
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.
What
Claude Code v2.1.234 changed how between-turn background-task notifications are delivered: they now arrive fully wrapped in
<system-reminder>...</system-reminder>tags, matching the wrapping mid-turn delivery already used, instead of the previous unwrapped<task-notification>...</task-notification>format.is_user_noise()treats any user entry that both starts with<system-reminder>and ends with</system-reminder>as pure harness-reminder noise and drops it entirely. Once a task notification is wrapped this way, it matches that rule and gets silently dropped instead of surfacing as the informationalSystemmessage it used to produce — losing the task's completed/failed/killed status from the trace view.Fix
unwrap_system_reminder()inclassify.rs, which strips a full<system-reminder>...</system-reminder>wrapper when the entire trimmed content is exactly that wrapper.is_user_noise()now checks the unwrapped inner content for a<task-notification>prefix before treating a<system-reminder>-wrapped entry as noise, so it falls through instead of being dropped.TASK_NOTIFICATION_TAGdispatch inclassify()also checks the unwrapped content, so the wrapped notification still classifies as aSystemmessage with the correctis_errorstatus (failed→ error,completed/killed→ informational).Tests
Added three regression tests in
classify.rs:<task-notification>wrapped in<system-reminder>still classifies as aSystemmessagefailednotification still setsis_error: trueVerification
npx tsc --noEmit,npx oxlint,npx oxfmt --check— cleancargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings— cleancargo fmt --manifest-path src-tauri/Cargo.toml --check— cleanvitest run— 498 passedcargo test --manifest-path src-tauri/Cargo.toml— 690 passed (including the 3 new tests)claude --debug -p "say hello"ran cleanly with no crash/panic in the trace-capture pathFixes #262