fix(playground): close audio WS on pagehide; add connectivity architecture doc#1
Open
parvbhullar wants to merge 1 commit into
Open
fix(playground): close audio WS on pagehide; add connectivity architecture doc#1parvbhullar wants to merge 1 commit into
parvbhullar wants to merge 1 commit into
Conversation
Tab close/refresh never ran the async disconnect() (browsers don't await async cleanup during unload), leaving the supervoice call - and its brain session - alive until the protocol keepalive timed out. A pagehide listener now synchronously closes /ws/audio so the server tears the call down immediately; it is registered on connect and removed on disconnect. Adds playground/docs/connectivity.md: process ownership map, the six wires and who dials whom, end-to-end call flow, the call-lifecycle invariant (kill on disconnect, fresh on connect, protocol keepalive as backstop), the history of the relay single-slot reconnect storm and its removal, and the reachability design note for future edge/NAT-hosted brain workers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
Closing or refreshing a playground tab never ran the async
disconnect()(browsers don't await async cleanup during unload), leaving the supervoice call — and its brain session — alive until the protocol keepalive timed out (~40 s). Separately, the playground's connectivity architecture (who owns what, who dials whom, why the dev relay storm happened) lived only in heads.Solution
pagehidelistener onSupervoiceWSTransport: synchronously closes/ws/audioon tab close/refresh so the server tears the call down immediately; registered on connect, removed ondisconnect().playground/docs/connectivity.md: process ownership map, the five wires and dial directions, end-to-end call flow, the call-lifecycle invariant (kill on disconnect, fresh on connect, protocol keepalive as backstop), history of the relay single-slot reconnect storm and its removal, and the reachability design note for future edge/NAT-hosted brain workers.Companion PR (supervoice side): parvbhullar/super#38.
Testing
tsc --noEmitclean; web unit tests 4/4 pass.supervoice/tests/test_audio_server_direct_bridge.pyin the companion PR.🤖 Generated with Claude Code