Skip to content

Add support for condensing full.jsonl -> transcript.jsonl (opencode and claude first)#788

Merged
computermode merged 15 commits intomainfrom
add-unified-claude-opencode-transcript
Mar 27, 2026
Merged

Add support for condensing full.jsonl -> transcript.jsonl (opencode and claude first)#788
computermode merged 15 commits intomainfrom
add-unified-claude-opencode-transcript

Conversation

@computermode
Copy link
Copy Markdown
Contributor

@computermode computermode commented Mar 26, 2026

Pulling out changes that have been tested from #754 to keep the diffs smaller.

With these changes, Opencode and Claude full.jsonl files can be transformed to a uniform transcript.jsonl format that only includes what the UI needs. The changes have also been validated with the UI: the generated transcript.jsonl format is parse-able for both of these agent types.

You may notice that the Claude changes are in a compact.go file: that's because that file will include what all the agents have in common. Since Claude is the default and has a decent amount of crossover already with its full.jsonl with other agents, that's why its code is within that shared file. The Opencode agent parser uses some of the helper methods from it.

Below are screenshots from the UI where I supplied the code with real full.jsonl files and generated transcript.jsonl files that I manually pushed up to the checkpoints v1 branch on a test repo (the metadata.json had to be updated to route to transcript.jsonl as well of course).

Screenshot 2026-03-25 at 3 48 49 PM Screenshot 2026-03-26 at 4 43 01 PM

Note

Medium Risk
Introduces new transcript-compaction logic that changes how tool results and streaming assistant fragments are merged/omitted, which could affect downstream UI parsing across multiple agent formats.

Overview
Adds a new transcript/compact package that converts agent transcripts into a normalized transcript.jsonl format with stable field ordering and per-line metadata (v, agent, cli_version).

For JSONL-based agents (Claude Code/Cursor), the converter now filters non-semantic event types, strips assistant thinking/redacted blocks and extra tool fields, merges streaming assistant fragments by message ID, and inlines tool_result outputs into preceding tool_use blocks while dropping tool-result-only user lines.

Adds OpenCode support by detecting the single-JSON session export format and emitting equivalent compact user/assistant lines (including tool parts and timestamps), plus comprehensive fixtures and unit tests covering truncation, mixed formats, and edge cases.

Written by Cursor Bugbot for commit f672fc9. Configure here.

@computermode computermode requested a review from a team as a code owner March 26, 2026 23:53
Copilot AI review requested due to automatic review settings March 26, 2026 23:53
@computermode computermode changed the title Add support for condensing opencode and claude to unified transcript.jsonl format Add support for condensing full.jsonl -> transcript.jsonl (opencode and claude first) Mar 26, 2026
@Soph Soph mentioned this pull request Mar 27, 2026
Copy link
Copy Markdown
Collaborator

@Soph Soph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and #793

Comment thread cmd/entire/cli/transcript/compact/opencode.go Outdated
Comment thread cmd/entire/cli/transcript/compact/testdata/claude_full.jsonl
Comment thread cmd/entire/cli/transcript/compact/compact.go Outdated
Comment thread cmd/entire/cli/transcript/compact/compact.go Outdated
@computermode computermode merged commit ed2931c into main Mar 27, 2026
3 checks passed
@computermode computermode deleted the add-unified-claude-opencode-transcript branch March 27, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants