Repository navigation
fix(host): recover open transcript watches after channel workers restart - #159
Merged
Merged
Conversation
iamnbutler
marked this pull request as draft
October 6, 2026 21:27
This was referenced Oct 6, 2026
This was referenced Oct 6, 2026
iamnbutler
marked this pull request as ready for review
October 6, 2026 22:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #153. Dogfooding #5.
Before: when a channel's worker restarted (for example
ace killthenace ask), the open chat stayed blank or stale while listings updated. Worker connections and peerGatewayClients ended watches silently; the app only re-watched when its own gateway reconnected.After: the app's transcript replays in place on the same gateway connection and shows new output.
Watch lifetime
useTranscriptowns each watch. Relays (worker or hostedConnection, the gateway, a peerGatewayClient) report how a watch ended and drop it; they never re-watch on their own.watchrequests keep relay entries.useTranscriptresets, re-fetches info and replays. It ignores watches it released and stops after 3 quick ends with Try again. A rejected watch retries only when asked, or once when an offline channel becomes reachable.remove()keeps the worker lock and removeschannel.jsonfirst; workers read the record only after taking the lock. A recovering watch can't start a worker over a channel being deleted.Rolling compatibility: the channel
Eventunion is unchanged; older clients drop a late failure frame, as they do today. No stored format changes.Evidence:
bun types,bun run ci, React Doctor 100/100 on changed files, and GitHub CI. The real transport smoke used workers and Anthropicclaude-haiku-4-5.Headless React verification: 32 of 32 checks passed using the built app in headless Chromium against the isolated source host. Covered:
Duplicates were checked with durable entry IDs. Details are in #153.
Pending
Built in Ace
The implementation, smoke runs, commits and PR were done by an agent in the Ace channel
channel-watch-recovery. Codex was used outside Ace to coordinate concurrent lanes and to independently review the code and this PR, because Ace can't run Codex as an external harness yet (#9). React was verified in headless Chromium through the shell because Ace has no browser automation surface (#50), and native capture is blocked while the macOS session is locked.