Skip to content

Fix issues #60, #59: /fork pointer entries and empty async hook entries#61

Closed
delexw wants to merge 2 commits intomainfrom
fix/issue-batch-2026-04-26_10_25_55
Closed

Fix issues #60, #59: /fork pointer entries and empty async hook entries#61
delexw wants to merge 2 commits intomainfrom
fix/issue-batch-2026-04-26_10_25_55

Conversation

@delexw
Copy link
Copy Markdown
Owner

@delexw delexw commented Apr 25, 2026

Summary

Compatibility fixes for two Claude Code regressions introduced in v2.1.118 and v2.1.119 that caused transcript parsing to break or produce incomplete results.

Fixed Issues

Changes

File What changed
src-tauri/src/parser/entry.rs Added forked_from: Option<Value> field; parse_entry now filters entries with empty type
src-tauri/src/parser/session.rs Session reconstruction handles forked entries — skips pointer entries when rebuilding the message tree

Tests

  • 351 Rust unit tests pass (cargo test)
  • 345 frontend tests pass (vitest run)
  • Clippy clean (cargo clippy -- -D warnings)

delexw added 2 commits April 26, 2026 10:20
When /fork is used to branch a conversation, Claude Code v2.1.118+
writes each inherited parent entry with a forkedFrom:{sessionId,
messageUuid} field instead of duplicating them verbatim.

Add forked_from: Option<Value> to Entry to capture this field.

In scan_session_metadata and IncrementalTokenScanner, skip entries
with forkedFrom set so that session metadata (turn_count, tokens,
first_message, duration, ongoing state) reflects only the fork's
own activity — not the inherited parent conversation.

The conversation view (read_session_incremental) still includes
inherited entries so the full history remains visible as context.

Closes #60
Claude Code pre-v2.1.119 had a bug where async PostToolUse hooks could
write JSONL transcript entries with empty or near-empty content.  An
entry that has a uuid but no type field would pass the existing
uuid-presence guard in parse_entry(), then fall through classify() and
produce a spurious meta AI message in the conversation view.

Add a second guard: if entry_type is empty after deserialization, return
None.  This matches the existing entry-discarded-if-broken policy and
is safe for all post-v2.1.119 sessions because valid entries always carry
a non-empty type.

Fixes #59
@delexw delexw closed this Apr 26, 2026
@delexw delexw deleted the fix/issue-batch-2026-04-26_10_25_55 branch April 26, 2026 10:55
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.

1 participant