[#117]: Document and test MessageDisplay hook event compat (v2.1.152)#120
Merged
Conversation
Claude Code v2.1.152 adds a new MessageDisplay hook event. The parser already handles it correctly — hook_event is a plain String, not an enum, so unknown event names are captured without rejection, and all classify paths use presence-of-hookEvent checks rather than exhaustive matching. This commit: - Adds a comment on the hook_event field in entry.rs documenting the String storage rationale for forward compatibility - Adds 5 new tests covering MessageDisplay as progress, system/ hook_progress, and attachment entries - Adds a comment in session.rs explaining the uuid gap assumption when a MessageDisplay hook hides a message entirely: the backward chain walk terminates gracefully at the gap via the existing _ => break arm - Updates specs/01-parser-pipeline.md with a MessageDisplay entry in the version-compatibility normalisations table Fixes #117
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
Claude Code v2.1.152 introduces a new
MessageDisplayhook event. This PR confirms that the parser already handles it correctly and adds explicit documentation and tests to prove it.Root cause analysis
hook_eventinEntryis stored as a plainString(not an enum), so new hook event names are captured without rejection or a code change.classify.rsrescue hook entries based on the presence of ahookEventfield, not an exhaustive match — soMessageDisplayflows through as aClassifiedMsg::Hookautomatically.MessageDisplayhook omits an entry from JSONL entirely) are handled gracefully by the_ => breakarm inresolve_live_chain_uuids, which terminates the backward chain walk without panicking.Changes
src-tauri/src/parser/entry.rshook_eventfield documenting that it is stored as a plainStringfor forward compatibility (v2.1.152+MessageDisplayincluded).parse_entry_captures_message_display_hook_event_as_stringandparse_entry_message_display_as_attachment_is_captured.src-tauri/src/parser/classify.rsMessageDisplayin all three entry shapes:classify_message_display_progress_entry_produces_hook_msgclassify_message_display_system_hook_progress_entry_produces_hook_msgclassify_message_display_attachment_entry_produces_hook_msgsrc-tauri/src/parser/session.rsresolve_live_chain_uuidsexplaining the uuid gap assumption forMessageDisplay-hidden entries and how the_ => breakarm handles it gracefully.specs/01-parser-pipeline.mdMessageDisplayrow to the Version-Compatibility Normalisations table.Test results
Fixes #117