Conversation
Entire-Checkpoint: 14bb6b63b74b
…nup command Entire-Checkpoint: bc5a6b843c22
PR SummaryMedium Risk Overview Updates the OpenCode agent’s parsing/analysis pipeline to operate on export JSON ( Written by Cursor Bugbot for commit ec397ef. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR refactors OpenCode transcript handling to use OpenCode's native export JSON format instead of plugin-generated JSONL. The TypeScript plugin now only sends the session ID to hooks, and the Go handler calls opencode export directly to obtain the full transcript. This architectural change eliminates race conditions between plugin shutdown and hook execution, ensures full data fidelity, and captures complete context on each checkpoint (not just from the last prompt).
Changes:
- TypeScript plugin simplified to remove transcript generation logic and only send session_id
- Go lifecycle handler now calls
opencode exportand caches results in.entire/tmp/ - All OpenCode transcript parsing changed from JSONL line-by-line format to export JSON structure
- Added temp file cleanup to
entire cleancommand - Updated all tests to use export JSON format instead of JSONL
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/agent/opencode/entire_plugin.ts | Removed transcript generation logic; plugin now only sends session_id |
| cmd/entire/cli/agent/opencode/lifecycle.go | Added fetchAndCacheExport to call opencode export and cache results |
| cmd/entire/cli/agent/opencode/types.go | Changed from JSONL Message type to export JSON ExportSession/ExportMessage types |
| cmd/entire/cli/agent/opencode/transcript.go | Replaced ParseMessages with ParseExportSession; added SliceFromMessage helper |
| cmd/entire/cli/agent/opencode/opencode.go | Implemented JSON-based ChunkTranscript/ReassembleTranscript |
| cmd/entire/cli/agent/opencode/cli_commands.go | Added runOpenCodeExport function |
| cmd/entire/cli/agent/opencode/*_test.go | Updated all tests to use export JSON format |
| cmd/entire/cli/lifecycle.go | Removed export JSON copy logic (no longer needed) |
| cmd/entire/cli/clean.go | Added temp file listing and deletion for .entire/tmp/ |
| cmd/entire/cli/clean_test.go | Updated test expectations and signatures |
| cmd/entire/cli/summarize/summarize.go | Updated buildCondensedTranscriptFromOpenCode for export JSON |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Added OpenCode case for transcript scoping |
| cmd/entire/cli/integration_test/*.go | Updated all integration tests for export JSON format |
Entire-Checkpoint: 307c262f9c8a
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 6 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
4ab2ee9 to
8addb6e
Compare
Entire-Checkpoint: 938d1244c4c6
…sn't written Entire-Checkpoint: 1b33ad469161
Entire-Checkpoint: 8606b4e2a007
Entire-Checkpoint: 03bc551af447
8addb6e to
c38639a
Compare
Entire-Checkpoint: 5e0994673a26
…andle this Entire-Checkpoint: c224d03045d8
# Conflicts: # cmd/entire/cli/rewind.go
This refactor changes how OpenCode transcript handling works. Previously, the TypeScript plugin wrote JSON/JSONL transcripts to temp files and passed the file paths to hooks.
Now, the plugin only sends the session ID, and the Go hook handler calls
opencode exportdirectly to get the native JSON format. This eliminates race conditions between plugin shutdown and the hook reading the transcript, and ensures full data fidelity by using OpenCode's own export format.This means we are not creating an artificial JSONL that is not compatible to our rendering for Claude Code JSONL anyway, and we are not generating our own OpenCode style JSON file with the risk of breaking imports in the future.
Also the old approach had an issue that we want the full log on each checkpoint, so if you resume/rewind we can restore the context before the last prompt too. The initial implementation only capture the log from the start of the last prompt.
Main things:
opencode exportto get the full logs so we can store themfile_pathbeing used and notfilePaththat broken checkpointing when only existing files were edited by tooling. New files worked (need to look at e2e test later if we need to make sure we have that...)