Skip to content

fixing checkpoint_transcript_start issue when agent continues writing logs#873

Merged
gtrrz-victor merged 2 commits intomainfrom
soph/offset-fix
Apr 10, 2026
Merged

fixing checkpoint_transcript_start issue when agent continues writing logs#873
gtrrz-victor merged 2 commits intomainfrom
soph/offset-fix

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Apr 8, 2026

Codex (and probably other agents) continue to write logs sometimes even after a commit was run. We handle this in the checkpoints but we aren't updating the position in the logs properly so these lines bleed into the next checkpoint and are shown as first messages in the UI.

This fixes this.


Note

Medium Risk
Touches checkpoint scoping state (CheckpointTranscriptStart) at turn end, which can affect what transcript content is shown per checkpoint; failure modes are mostly incorrect UI context rather than data loss.

Overview
Prevents checkpoints created by mid-turn commits from leaving checkpoint_transcript_start behind when the agent keeps writing to the transcript after the commit; HandleTurnEnd now advances SessionState.CheckpointTranscriptStart to the current transcript position when TurnCheckpointIDs exist.

Adds integration tests covering (1) commits triggered in a later turn still include prior uncommitted-turn transcript content in the checkpoint scope, and (2) CheckpointTranscriptStart advances past the commit-time position once Stop finalizes a turn.

Reviewed by Cursor Bugbot for commit 17ee3e8. Configure here.

@Soph Soph requested a review from a team as a code owner April 8, 2026 16:36
Copilot AI review requested due to automatic review settings April 8, 2026 16:36
Copy link
Copy Markdown
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

Fixes incorrect checkpoint_transcript_start handling when an agent performs a mid-turn commit but continues appending transcript/log lines afterward, which previously caused “tail” content to appear at the start of the next checkpoint in the UI.

Changes:

  • Advance SessionState.CheckpointTranscriptStart at turn end to the actual transcript end when mid-turn commits occurred.
  • Add integration tests covering transcript offset behavior across uncondensed turns and mid-turn commits.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cmd/entire/cli/strategy/manual_commit_hooks.go Updates turn-end handling to advance CheckpointTranscriptStart after mid-turn commits to prevent transcript bleed into the next checkpoint.
cmd/entire/cli/integration_test/transcript_offset_test.go Adds integration coverage for checkpoint_transcript_start behavior across turns and mid-turn commits.

Copy link
Copy Markdown

@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.

Fix All in Cursor

❌ 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

Reviewed by Cursor Bugbot for commit 17ee3e8. Configure here.

@Soph Soph force-pushed the soph/offset-fix branch from 21ae654 to 7c66fd7 Compare April 10, 2026 07:55
Copy link
Copy Markdown
Contributor

@gtrrz-victor gtrrz-victor left a comment

Choose a reason for hiding this comment

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

Tested and working great!

@gtrrz-victor gtrrz-victor merged commit 3818101 into main Apr 10, 2026
9 checks passed
@gtrrz-victor gtrrz-victor deleted the soph/offset-fix branch April 10, 2026 08:39
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