Skip to content

Comments

fix mid turn commits not creating checkpoints#466

Merged
gtrrz-victor merged 2 commits intomainfrom
soph/opencode-refactor-bugfix
Feb 23, 2026
Merged

fix mid turn commits not creating checkpoints#466
gtrrz-victor merged 2 commits intomainfrom
soph/opencode-refactor-bugfix

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Feb 23, 2026

If OpenCode was given instructions like "do xyz and then commit" the commit would be created with a Entire-Checkpoint trailer but no checkpoint in entire/checkpoints/v1 was created. The reason was that the session log was only exported at the end of the prompt, now we export it on demand.

Entire-Checkpoint: b508e03d5243
Copilot AI review requested due to automatic review settings February 23, 2026 15:03
@Soph Soph requested a review from a team as a code owner February 23, 2026 15:03
@cursor
Copy link

cursor bot commented Feb 23, 2026

PR Summary

Medium Risk
Touches the condensation/hook path for all agents via a new best-effort transcript preparation step; failures are ignored, but it changes when/if transcripts are read or generated during commits.

Overview
Fixes OpenCode mid-turn agent commits that previously added an Entire-Checkpoint trailer but failed to write checkpoint data to entire/checkpoints/v1, by ensuring a transcript exists before condensation reads it.

Adds OpenCodeAgent.PrepareTranscript() to lazily create the .entire/tmp/<sessionID>.json transcript via opencode export when missing, wires a best-effort prepareTranscriptIfNeeded() into the manual-commit condensation and hook paths, and extends unit/integration tests (including a new TestOpenCodeMidTurnCommit) plus test helpers to pre-seed mock exports.

Written by Cursor Bugbot for commit be0edec. Configure here.

squishykid
squishykid previously approved these changes Feb 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.TranscriptPreparer for OpenCode to export transcripts on demand.
  • Add integration + unit tests covering mid-turn commit checkpoint creation and PrepareTranscript validation 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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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
Base automatically changed from soph/opencode-refactor to main February 23, 2026 16:20
@Soph Soph dismissed squishykid’s stale review February 23, 2026 16:20

The base branch was changed.

@gtrrz-victor gtrrz-victor merged commit 985ccc6 into main Feb 23, 2026
3 checks passed
@gtrrz-victor gtrrz-victor deleted the soph/opencode-refactor-bugfix branch February 23, 2026 23:40
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