Skip to content

Quitting right after work saves quietly and never branches bookkeeping - #2001

Merged
AbirAbbas merged 3 commits into
devfrom
fix/quit-after-task
Oct 27, 2026
Merged

AbirAbbas merged 3 commits into
devfrom
fix/quit-after-task

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

The last real PC + Mac round (round 11, published dev build dev-20261027-644a38e6b403) passed every step except one: quitting codeaf right after a background task finished.

What was wrong

  • /quit right after a task printed codeaf could not save this chat …, left the hold behind, and the other computer saw this one as offline. The drive's closing step cancelled a publish the relay had already accepted, then retried it with the old head and conflicted with itself (409).
  • An ordinary quit gave up after about 12 s while saying up to 30s. The close and detach calls used the ordinary 10 s call deadline, and the save then succeeded after the failure had been printed.
  • Each launch sealed an empty turn onto the chat, even one another computer held. A later take turned those turns, plus a late cost record, into a branch chat nobody typed (… 1 turn · <computer> on the other computer's Home).
  • A removed computer's quit said it could not save, which can never be resolved there.

What changes

  • Close joins the publish in flight, publishes the newest head, records it, and releases.
  • Close and detach wait for the shared saving bound. A reply that never came says the save is still finishing, not that it failed.
  • A launch never seals an empty turn, and a viewer never seals at all. On a take, accounting-only history (usage, cost, title or memory bookkeeping) is adopted rather than kept as edits. Real edits are still kept.
  • A removed computer's quit saves locally and prints nothing.
  • The chat manual's quit and continue pages say what happens now.

Proof
Hosted-path tests through the real engine host and native engine, one per behaviour. Each fails on 644a38e6b and passes here. A PC + Mac round on this branch follows before merge.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits October 27, 2026 10:44
A quit straight after a finished task could report "could not save", leave its
hold behind and make the other computer see this one as offline. The drive's
closing step cancelled a publish the relay had already accepted, then retried
it with the old head and got a conflict from itself. Close now joins the
publish in flight, publishes the newest head, and releases.

The saving wait also stopped at the ordinary ten-second call deadline while
saying "up to 30s", so a save that went on to succeed was reported as failed.
Close and detach now use the shared saving bound, and a reply that never came
says the save is still finishing rather than that it failed.

Each launch sealed an empty turn onto the chat, even one held elsewhere, and a
later take turned those turns plus late cost records into a branch chat nobody
typed. A launch no longer seals an empty turn, a viewer never seals, and
accounting-only history is adopted on a take instead of kept as edits. A
removed computer's quit saves locally and prints nothing.

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 marked this pull request as ready for review October 27, 2026 14:45
The quit's finishing flag was set and read under a lock released by hand, which
turns an absorbed panic into a deadlock. Both now go through small helpers that
unlock from a defer, as the rest of this file does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit cc1aaa8 into dev Oct 27, 2026
9 checks passed
@AbirAbbas
AbirAbbas deleted the fix/quit-after-task branch October 27, 2026 15:09
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