fix(checkpoint): copy a legacy checkpoint from the v1 copy that changed it last

main

Commit

Muskan Paliwal2d ago

Under git-refs nothing advances the local v1 branch, while a plain git fetch still advances its remote-tracking copy. The copy on write always took local v1, so a teammate's newer sessions on v1 were left out of the checkpoint's ref, and once pushed that ref hid them from every clone that reads refs first. The copy now takes the checkpoint from whichever copy changed it last. When both changed it since they split and the remote has no ref for it, nothing is copied and the write fails with ErrLegacyCheckpointDiverged, since either copy would hide the other's sessions.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M6GK0HG13X2A1BXWP7QMX6G7