fix mid turn commits not creating checkpoints#466
Conversation
Entire-Checkpoint: b508e03d5243
PR SummaryMedium Risk Overview Adds Written by Cursor Bugbot for commit be0edec. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR addresses missing checkpoint data for OpenCode “mid-turn” commits by ensuring the OpenCode transcript is made available on-demand (instead of only at turn-end), so condensation can write checkpoint metadata to entire/checkpoints/v1.
Changes:
- Add a strategy-level helper to best-effort “prepare” (materialize/flush) transcripts before reading them.
- Implement
agent.TranscriptPreparerfor OpenCode to export transcripts on demand. - Add integration + unit tests covering mid-turn commit checkpoint creation and
PrepareTranscriptvalidation behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/manual_commit_hooks.go | Ensures transcript is prepared before attempting transcript-based file extraction during hook flows. |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Prepares live transcript before reading it for condensation, including mid-session commit paths. |
| cmd/entire/cli/strategy/common.go | Adds prepareTranscriptIfNeeded helper to invoke TranscriptPreparer best-effort. |
| cmd/entire/cli/agent/opencode/transcript.go | Declares OpenCode implements agent.TranscriptPreparer. |
| cmd/entire/cli/agent/opencode/lifecycle.go | Implements OpenCodeAgent.PrepareTranscript using opencode export (or mock mode). |
| cmd/entire/cli/agent/opencode/lifecycle_test.go | Adds unit tests for PrepareTranscript path validation / no-op behavior. |
| cmd/entire/cli/integration_test/opencode_hooks_test.go | Adds integration test for mid-turn agent commit creating checkpoint data on metadata branch. |
| cmd/entire/cli/integration_test/hooks.go | Adds helper to stage a mock OpenCode export file in .entire/tmp/ for tests. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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
Entire-Checkpoint: 70ec8a26d72b
If OpenCode was given instructions like "do xyz and then commit" the commit would be created with a
Entire-Checkpointtrailer but no checkpoint inentire/checkpoints/v1was created. The reason was that the session log was only exported at the end of the prompt, now we export it on demand.