Skip to content

cellsync: let a chat go on quit only after its last save uploaded - #1918

Merged
AbirAbbas merged 2 commits into
devfrom
abir/quit-release-after-upload
Oct 24, 2026
Merged

AbirAbbas merged 2 commits into
devfrom
abir/quit-release-after-upload

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Found by the Raft wave's client-wiring packet, reproduced on today's dev.

Bug: Batcher.Close released the lease even when the final upload failed. The relay then announced a clean quit (released_at set, lease expired) while this computer still held unsent turns, so the other computer could continue automatically (C31.1) from the older saved head.

Fix: Close returns the failed upload and keeps the lease; it releases only after a successful publish. A later close that succeeds publishes and then releases.

Proof:

  • TestC28C31FailedFinalUploadDoesNotRelease (cellsync): fails on dev (ReleasedAt set with 1 pending), passes with the fix, including the successful retry.
  • TestC28C31FailedQuitKeepsFinalRecordsAndDoesNotRelease (syncsetup, real engine, two homes, only the upload path blocked): fails on dev ("failed quit advertised a release"), passes with the fix; the final turn stays in the local transcript.

The manual's quit-while-saving section says what now happens.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits October 24, 2026 05:38
Close released the lease even when the final upload failed, so the relay
announced a clean quit while this computer still held unsent turns, and the
other computer could continue automatically from the older head. Close now
returns the failed upload and keeps the lease; it releases after a successful
publish.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit 502ed96 into dev Oct 24, 2026
6 checks passed
@AbirAbbas
AbirAbbas deleted the abir/quit-release-after-upload branch October 24, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant