[#86]: Add effort and terminalSequence fields for Claude Code v2.1.133+/v2.1.141+ compat#87
Merged
Conversation
….1.141+ compat
Claude Code v2.1.133 injects effort:{level} into hook input JSON and v2.1.141
adds terminalSequence to hook output entries. Add both fields to the Entry
struct so they are captured rather than silently dropped. The parser already
uses serde defaults (no deny_unknown_fields), so no crash risk exists, but
explicit fields allow callers to inspect the values.
Add 5 new tests covering effort capture, terminalSequence capture, absent-field
defaults, and unknown-field resilience for future Claude Code versions.
Fixes #86
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
Fixes #86 — Claude Code v2.1.133 and v2.1.141 introduced new fields in hook-related JSONL entries that the parser should handle explicitly.
Changes in Claude Code:
effort: {level: "low"|"normal"|"high"}at the top level.terminalSequenceat the top level (for desktop notifications, window titles, bells).What changed
src-tauri/src/parser/entry.rs— two new fields added to theEntrystruct:The parser already used serde defaults (no
#[serde(deny_unknown_fields)]anywhere), so these fields were silently ignored before — no crash risk existed. This PR makes the capture explicit so callers can inspect the values.Tests added (5 new)
parse_entry_captures_effort_field_v2_1_133— verifieseffort.levelis captured from hook progress entriesparse_entry_effort_defaults_to_none_when_absent— pre-v2.1.133 entries haveeffort: Noneparse_entry_captures_terminal_sequence_field_v2_1_141— verifiesterminalSequenceis captured from hook output entriesparse_entry_terminal_sequence_defaults_to_none_when_absent— older hook entries haveterminal_sequence: Noneparse_entry_unknown_fields_are_silently_ignored— documents and verifies future unknown fields don't crash the parserVerification