Fix conversation log parsing bugs (CC-41) #45

Merged
mprihoda merged 22 commits from CC-41 into main 2026-04-10 21:40:42 +00:00
mprihoda commented 2026-04-10 21:39:55 +00:00 (Migrated from github.com)

Summary

  • Fix entry type name mismatches: Parser now uses correct type names from real Claude Code JSONL ("user" instead of "human", hyphens instead of underscores), and handles "permission-mode" and "attachment" entry types
  • Fix SubAgentMetadataParser: Derives agentId from transcript filename instead of requiring it in JSON (which doesn't contain it)
  • Support entries without UUID: Made uuid optional in ConversationLogEntry so entries like permission-mode and file-history-snapshot are no longer silently dropped

Impact

Before these fixes, parsing real Claude Code transcripts resulted in:

  • numTurns always 0 (all user entries dropped)
  • Empty sub-agent lists (metadata parsing always failed)
  • Missing entries for types without UUID field

Test plan

  • All existing tests updated to use correct type names from real data
  • 11 new regression tests across all three defects
  • All tests pass (./mill __.test)
  • Code reviewed in 3 phase PRs (#42, #43, #44)

Release Notes

Parsování konverzačních logů z Claude Code nyní správně rozpoznává všechny typy záznamů. Uživatelské zprávy, metadata subagentů a záznamy bez UUID již nejsou tiše zahazovány.

🤖 Generated with Claude Code

## Summary - **Fix entry type name mismatches**: Parser now uses correct type names from real Claude Code JSONL (`"user"` instead of `"human"`, hyphens instead of underscores), and handles `"permission-mode"` and `"attachment"` entry types - **Fix SubAgentMetadataParser**: Derives `agentId` from transcript filename instead of requiring it in JSON (which doesn't contain it) - **Support entries without UUID**: Made `uuid` optional in `ConversationLogEntry` so entries like `permission-mode` and `file-history-snapshot` are no longer silently dropped ## Impact Before these fixes, parsing real Claude Code transcripts resulted in: - `numTurns` always 0 (all user entries dropped) - Empty sub-agent lists (metadata parsing always failed) - Missing entries for types without UUID field ## Test plan - [x] All existing tests updated to use correct type names from real data - [x] 11 new regression tests across all three defects - [x] All tests pass (`./mill __.test`) - [x] Code reviewed in 3 phase PRs (#42, #43, #44) ## Release Notes Parsování konverzačních logů z Claude Code nyní správně rozpoznává všechny typy záznamů. Uživatelské zprávy, metadata subagentů a záznamy bez UUID již nejsou tiše zahazovány. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/claude-code-query!45
No description provided.