Skip to content

fix(parser): compat with Claude Code v2.1.154 Dynamic Workflow entries#118

Merged
delexw merged 1 commit into
mainfrom
fix-issue-115
Jun 3, 2026
Merged

fix(parser): compat with Claude Code v2.1.154 Dynamic Workflow entries#118
delexw merged 1 commit into
mainfrom
fix-issue-115

Conversation

@delexw
Copy link
Copy Markdown
Owner

@delexw delexw commented May 31, 2026

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.rs

Added four workflow state fields to Entry:

  • workflowId (→ workflow_id) — workflow identifier
  • workflowName (→ workflow_name) — human-readable name
  • workflowRunUrl (→ workflow_run_url) — URL for the workflow run
  • workflowStatus (→ workflow_status) — lifecycle status string

All four fields have #[serde(default)] so they default to "" on pre-v2.1.154 sessions. No #[serde(deny_unknown_fields)] is set on Entry, so additional future workflow fields are also tolerated automatically.

src-tauri/src/parser/classify.rs

Added five workflow lifecycle entry types to NOISE_ENTRY_TYPES:

  • workflow-start
  • workflow-progress
  • workflow-complete
  • workflow-cancelled
  • workflow-error

These entries carry workflow state metadata but no displayable message content. Listing them explicitly in NOISE_ENTRY_TYPES ensures they are silently discarded before reaching the role-based fallback path, matching the same pattern used for fork-context-ref and queue-operation.

The existing tool_use extraction path in extract_assistant_details already handles any tool name generically, so the new Workflow tool block in assistant messages works without changes.

specs/01-parser-pipeline.md

Updated 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 correctly
  • parse_entry_workflow_fields_default_to_empty_when_absent — pre-v2.1.154 entries unaffected
  • parse_entry_workflow_entry_with_unknown_fields_succeeds — future fields tolerated
  • parse_entry_all_workflow_lifecycle_types_succeed — all five types parse without panicking

classify.rs (3 new tests):

  • classify_drops_all_workflow_lifecycle_entry_types_as_noise — all five types silently dropped
  • classify_workflow_tool_use_in_assistant_message_is_extractedWorkflow tool_use block extracted correctly
  • classify_workflow_start_with_data_fields_is_still_dropped — lifecycle entries dropped even when carrying workflow fields

Verification

  • 414 Rust tests pass (cargo test)
  • cargo clippy -- -D warnings clean
  • Frontend tests: 349 passed (vitest)

Fixes #115

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
@delexw delexw merged commit 2e37441 into main Jun 3, 2026
1 check passed
@delexw delexw deleted the fix-issue-115 branch June 3, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Compat] Claude Code v2.1.154: Dynamic Workflows introduce new JSONL entry types and workflow-state fields

1 participant