fix(parser): compat with Claude Code v2.1.154 Dynamic Workflow entries#118
Merged
Conversation
v2.1.154 ships dynamic workflows, which writes new JSONL entry types (workflow-start, workflow-progress, workflow-complete, workflow-cancelled, workflow-error) and workflow state fields (workflowId, workflowName, workflowRunUrl, workflowStatus) to session files. - Add the five workflow lifecycle types to NOISE_ENTRY_TYPES so they are silently discarded rather than reaching the role-based fallback path - Add workflowId, workflowName, workflowRunUrl, workflowStatus fields to Entry so they are captured without triggering deny_unknown_fields panics - Add tests covering: all five types parsed and discarded, workflow fields round-tripped, Workflow tool_use block extracted from assistant messages, and unknown future workflow fields tolerated by the deserializer - Update specs/01-parser-pipeline.md with new fields and compat table row Fixes #115
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.154 ships "dynamic workflows" — a system that lets Claude orchestrate background agents and track their progress. This feature writes new JSONL entry types and new top-level fields to session files that the parser must tolerate.
Changes
src-tauri/src/parser/entry.rsAdded four workflow state fields to
Entry:workflowId(→workflow_id) — workflow identifierworkflowName(→workflow_name) — human-readable nameworkflowRunUrl(→workflow_run_url) — URL for the workflow runworkflowStatus(→workflow_status) — lifecycle status stringAll four fields have
#[serde(default)]so they default to""on pre-v2.1.154 sessions. No#[serde(deny_unknown_fields)]is set onEntry, so additional future workflow fields are also tolerated automatically.src-tauri/src/parser/classify.rsAdded five workflow lifecycle entry types to
NOISE_ENTRY_TYPES:workflow-startworkflow-progressworkflow-completeworkflow-cancelledworkflow-errorThese entries carry workflow state metadata but no displayable message content. Listing them explicitly in
NOISE_ENTRY_TYPESensures they are silently discarded before reaching the role-based fallback path, matching the same pattern used forfork-context-refandqueue-operation.The existing
tool_useextraction path inextract_assistant_detailsalready handles any tool name generically, so the newWorkflowtool block in assistant messages works without changes.specs/01-parser-pipeline.mdUpdated the Key Fields table and Version-Compatibility Normalisations table to document the new fields and entry types.
Tests Added
entry.rs(4 new tests):parse_entry_captures_workflow_fields_v2_1_154— all four fields round-trip correctlyparse_entry_workflow_fields_default_to_empty_when_absent— pre-v2.1.154 entries unaffectedparse_entry_workflow_entry_with_unknown_fields_succeeds— future fields toleratedparse_entry_all_workflow_lifecycle_types_succeed— all five types parse without panickingclassify.rs(3 new tests):classify_drops_all_workflow_lifecycle_entry_types_as_noise— all five types silently droppedclassify_workflow_tool_use_in_assistant_message_is_extracted—Workflowtool_use block extracted correctlyclassify_workflow_start_with_data_fields_is_still_dropped— lifecycle entries dropped even when carrying workflow fieldsVerification
cargo test)cargo clippy -- -D warningscleanFixes #115