Repository navigation
Description
What happened
This came up on dev@cf282ddc6 (2026-10-26), in a two-computer relay test with real models. On one computer the
chat engine's furrow socket file disappeared while furrow kept running. After that, nothing on screen told the
person the truth:
· calls are not being sealed, so rewind cannot reach them: seal: snapshot: engine unavailable: dial unix <CODEAF_HOME>/v3/engine-0.3.4-<hash>.sock: connect: no such file or directory
· sealing works again, and the calls made meanwhile are sealed now
The second line was false for the chat's turns:
- The turn answered just before it was never sealed into the chat or published.
- The chat's hold on the relay lapsed, so another computer later took the chat at the previous turn.
- A clean
/quitprinted nothing on screen. Only the engine log and stderr said
codeaf: could not finish saving this chat: seal: snapshot: engine unavailable ….
Closing the chat in this state froze the window for about 35–60 s: no redraw and no key echo. The queued keys were
replayed afterwards. One of them sent another chat's draft.
The turn was not lost in the end. The next take on that computer kept it as kept as 1 turn from <device>. But the
person was told sealing had recovered, and the window kept acting as the chat's writer after its hold lapsed.
Replication
Deterministic (no model). The trigger, an orphaned furrow removing a socket path it no longer owns:
- Start
codeafon a throwawayCODEAF_HOME=Hand open a chat, so the engine starts its furrow
(furrow … serve --socket H/v3/engine-<v>.sock --idle-minutes 10). kill -9the engine only. Its furrow child survives.rm -rf H, then startcodeafonHagain and open a chat. A new furrow binds the same socket path. Turns work.- Wait for the orphan's idle exit (about 10 min). It removes the socket path, which now belongs to the new furrow.
- The new furrow still listens and still holds
engine-<v>.sock.lock, but the path is gone. Every dial fails with
no such file or directory, and a freshly started furrow finds the lock held and exits. Nothing recovers until
that furrow dies.
Step 3's rm -rf of a live home is what a test harness does, not a person. The gaps below matter whatever makes the
engine unreachable mid-chat.
Field (real models). After step 5, send a turn and then /quit. Expect the two sentences above, no publish
for the turn, and a silent quit.
Where
- furrow's
serve: socket cleanup on idle exit. It should unlink only a path that is still its own socket, compared
by device and inode. internal/cellstore/daemonstart.go,startAndDial/awaitDial: a held lock with no socket file is never
treated as a stuck daemon.internal/cellstore/sealwatch.go, the stringsealing works again: it fires on any later successful seal, while
the chat's turn seal or publish still fails.cmd/codeaf/main.go, the stringcould not finish saving this chat: stderr only, never on screen.- The chat-close path in
internal/tui3: it blocks the update loop while the engine is unreachable.
The fix
- A furrow that exits removes only its own socket.
- A client that finds a held lock and no socket says plainly that saving is stuck, and tells the person how to
recover. It doesn't wait forever. sealing works againappears only once the chat's own turns are sealed and published again.- A quit that cannot save says so on screen, and names where the unsaved turns are kept.
- Closing a chat never freezes the window.
Acceptance
An e2e test that drives the real binary through the deterministic replication above (a scripted model is enough),
asserting all of:
- no
sealing works againline while the turn is unsealed; - an on-screen sentence at
/quitthat the chat could not be saved; - the window redraws within a second of the close key;
- after the engine recovers, the turn is sealed and published, or kept as a branch, with the matching sentence.
Activity
Two-computer relay: fast take-back, moved task pages, honest saving, …