Skip to content

fix(sensor): preserve Claude transcript content and incremental updates - #130

Open
barisozbas wants to merge 1 commit into
mainfrom
wt/claude-parser-refresh
Open

barisozbas wants to merge 1 commit into
mainfrom
wt/claude-parser-refresh

Conversation

@barisozbas

@barisozbas barisozbas commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Recover complete JSONL records conservatively, preserve mixed text and tool
results, correlate results with exact tool invocations, and distinguish child
sessions. Track content changes so incremental capture includes resumed turns.

Add synthetic parser and observer regression coverage and document limitations.

String/text-block messages, mixed user text and tool results, repeated identical
tool calls, malformed records, child-session identity, and appended turns now have
regression coverage. Subagent discovery includes nested subagents directories
documented in Claude Code.

What type of PR is this?

  • Bug Fix
  • Documentation Update

Related issue: None; parser maintenance. Complements #38 without implementing
its tool classification, MCP attribution, or error-status changes.

Why? Valid recorded content could be omitted or attributed to the wrong tool
invocation, and local incremental capture could skip resumed Claude sessions.

Test Plan

  • 329 sensor tests pass locally on Python 3.9 and 3.12, using synthetic transcripts
    and in-memory exporters. Ruff and whitespace checks pass.
  • CI sensor matrix passes on Python 3.9–3.13.
  • No live Claude sessions were read and no collector was contacted for validation.

Potential risks: Child-session IDs now include the agent identifier; downstream
consumers should use the recorded parent relationship. All recorded branches remain
in file order; this is not an active-branch reconstruction. Existing truncation is
unchanged. Native Windows/macOS/Linux installations were not end-to-end tested.

Revert Plan

Revert this commit to restore the previous parsing and incremental behavior;
previously written normalized session files are not automatically removed.

Recover complete JSONL records conservatively, preserve mixed text and tool
results, correlate results with exact tool invocations, and distinguish child
sessions. Track content changes so incremental capture includes resumed turns.

Add synthetic parser and observer regression coverage and document limitations.
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