Skip to content

Checkpoints v2: support attach command#955

Merged
computermode merged 7 commits intomainfrom
attach-v2-checkpoints
Apr 15, 2026
Merged

Checkpoints v2: support attach command#955
computermode merged 7 commits intomainfrom
attach-v2-checkpoints

Conversation

@computermode
Copy link
Copy Markdown
Contributor

@computermode computermode commented Apr 14, 2026

Wires up the attach command to support checkpoints v2. Supports dual-write to v1 and v2 checkpoints when v2 is enabled.

This change is not user facing and should not introduce any changes to the checkpoints v1 attach flow.

(Used the 994182ab5aba test checkpoint in d35e512 to ensure the new v2 checkpoint flow was executed correctly via attach.)


Note

Medium Risk
Adds conditional dual-write and backfill logic during attach, which touches git ref storage and migration paths; failures are logged but could lead to v1/v2 divergence if bugs slip through.

Overview
attach now optionally mirrors committed checkpoints into checkpoints v2 when strategy_options.checkpoints_v2 is enabled, while continuing to write to v1 as before.

When attaching to an existing v1-only checkpoint, it backfills the full checkpoint into v2 (rewriting all sessions and copying task metadata when needed) to avoid creating a partial v2 shadow; v2 write failures are treated as best-effort and only logged.

Tests add coverage for v2 dual-write output (including compact + raw transcript files in v2 refs) and for backfilling an existing v1 checkpoint after enabling v2.

Reviewed by Cursor Bugbot for commit 73e4598. Configure here.

Entire-Checkpoint: 994182ab5aba
Entire-Checkpoint: 5d59e5e1153a
@computermode computermode requested a review from a team as a code owner April 14, 2026 20:04
Copilot AI review requested due to automatic review settings April 14, 2026 20:04
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

Wires up attach to dual-write checkpoints into the v2 ref layout when checkpoints_v2 is enabled, including a v1→v2 backfill path when attaching to an existing v1 checkpoint.

Changes:

  • Extend runAttach to generate a compact transcript and best-effort dual-write to v2 when checkpoints_v2 is enabled.
  • Add attach-specific v2 backfill logic to mirror existing v1-only checkpoints into v2 refs.
  • Add tests covering v2 dual-write and v1-only → v2 backfill behavior for attach.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
cmd/entire/cli/attach.go Adds v2 dual-write + backfill logic for attach-created checkpoints (best-effort, non-blocking).
cmd/entire/cli/attach_test.go Adds coverage for v2 dual-write and backfilling an existing v1-only checkpoint into v2.
test Empty file present in the PR contents (no functional change visible from provided diff).

Comment thread cmd/entire/cli/attach.go Outdated
Entire-Checkpoint: 3ec3debb679a
Entire-Checkpoint: fa587109fd1d
Copy link
Copy Markdown
Contributor

@pfleidi pfleidi left a comment

Choose a reason for hiding this comment

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

Thanks!

@computermode computermode enabled auto-merge April 15, 2026 16:03
@computermode computermode merged commit ba21594 into main Apr 15, 2026
9 checks passed
@computermode computermode deleted the attach-v2-checkpoints branch April 15, 2026 16:06
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