Repository navigation
Description
Found while working #1362 (delivered by #3390).
Context
#1362 made the typed server-frame handler map (packages/ui-react/src/hooks/websocket-handlers/index.ts, exhaustive via satisfies ServerMessageHandlerMap<ServerMessageType> at :63) the single routing table for retry_receipt, ask_answer_receipt and session_queue. Several map entries are still no-ops, because something upstream of the map consumes those frames:
pong: the SDK client answers its own liveness probes and returns before any consumer handler (private receive,packages/ui-sdk/src/client/ws-client.ts:295-314), so the frame never reaches a consumer. ui-react still carriespong: () => {}(packages/ui-react/src/hooks/websocket-handlers/chat.ts:405-406; listed in the chat frame union at:33) because the map is keyed on the publicServerMessageunion (export type ServerMessage,packages/ui-sdk/src/protocol.ts:796, memberServerPongat:817). The SDK client's public consumer handler type is keyed on the same union (packages/ui-sdk/src/client/ws-client.ts:79-82).dialogue_history,tool_resolutionandconversation_opened/closed/event/work/output/permission: the voice conversation client reads them in itsframeprefilter before the map runs (function frame(message: ServerMessage),packages/ui-react/src/voice/conversation-client.ts:547). Some of them are returned unchanged and then reach the no-op entries inpackages/ui-react/src/hooks/websocket-handlers/connection.ts(dialogue_historyat:11,tool_resolutionat:44, the sixconversation_*entries at:50-55).
Citations re-verified at main d990c0ab3 (the protocol and connection.ts lines moved since 3d3516a02). On epic/1342-turn-path-split (b93ced200) they read protocol.ts:793/:814 and connection.ts:47-52.
Sequencing: #3390 (for #1362) is what turns the retry_receipt, ask_answer_receipt and session_queue entries into real handlers. It merged into epic/1342-turn-path-split, not main. On main those three entries are still () => {} (chat.ts:403-404, connection.ts:46). This issue edits the same two handler files, and its "no () => {} entry for these frames" criterion assumes #3390's map, so it starts from main after #1362 closes when that epic's batch lands.
Blocked by #1362
Decision (maintainer, 2026-11-03)
- Voice-owned frames: A. Move handling of
dialogue_history,tool_resolutionand the sixconversation_*frames into handler-map entries backed by the conversation client, so the map is the only router. The voiceframeprefilter stops routing these frames. This is the riskier option, so voice regression proof is required. pong: A. Removepongfrom the consumer-facing frame union, so no handler entry is needed.ServerMessageandServerPongare exported from the public@schlessera/brain-ui-sdk/protocolentry point and key the public./clienthandler type, so this is a breaking type contract change (see Contract impact). The wire frame itself and the SDK client's own liveness handling stay as they are.
Rejected: B on both questions ("consumed upstream" markers with proving tests).
Scope
- Voice: add real map entries for the eight voice-owned frames that call into the conversation client; remove the corresponding routing from the conversation client's
frameprefilter; no behaviour change for the person using voice. pong: define the consumer-facing frame union withoutpong(the wire-level union thatparseServerMessagevalidates keeps it), key the SDK client's consumer handlers (ws-client.ts:79-82) and ui-react'sServerMessageHandlerMapon it, and delete thepongentry and union member from ui-react.- Contract docs, changeset naming the break,
contract+breakinglabels on the PR.
Out of scope
- Wire protocol changes:
pongstays on the wire and in the parser's union. - Changing what the voice client does with any of these frames (only where it is routed from).
- Frames whose map entries already do work.
chat_retired: () => {}(connection.ts:49on main). It is inert on purpose until ui-react: design own-chat deletion and targeted cache retirement #3231 decides chat deletion, because this client does not declarechatDeletion.
Acceptance criteria
- No handler-map entry for these frames is a
() => {}: each of the eight voice-owned frames is handled by a map entry backed by the conversation client, and the voice prefilter no longer routes them. -
pongis absent from the consumer-facing frame union, the SDK client's consumer handler type and ui-react's handler map; the map stays exhaustive over the consumer union (satisfies), and the SDK client still consumespongfor liveness. - Voice regression proof: existing voice/conversation-client tests pass unchanged, plus a test per voice-owned frame showing it reaches the conversation client through the map, failing if the map entry is removed (mutation receipt).
- A type-level test (or
tscfixture) shows a consumerponghandler is no longer accepted and the parser still accepts a wirepong. - Contract docs updated for the removed consumer type member; changeset names the break.
- Existing websocket-handler tests pass.
Verification
bun run test packages/ui-react and bun run test packages/ui-sdk, typecheck and lint, with mutation receipts for the new map-routing tests. Real-browser voice runtime tests in the pinned offline image if any exist for these frames.
Contract impact
Breaking (type-level): removing pong from the consumer-facing frame type of the public @schlessera/brain-ui-sdk/protocol / ./client entry points. Before 1.0 it ships in a minor with the breaking label, this ruling, and a changeset naming the break; CONTRACT: commit with the contract doc updated in the same commit. No wire change.
Triage 2026-11-03: folded the maintainer ruling (Q1 A: map routes voice-owned frames; Q2 A: drop pong from the consumer union, breaking type change).
Triage 2026-11-03 (second pass): refreshed the drifted citations to main d990c0ab3 and declared #1362 as the blocker, because #3390 has not reached main and touches the same handler files. Added chat_retired to out of scope. Milestone 0.45.0: a direct follow-up of #1362's 0.45.0 work with a recorded ruling, bounded to the handler map, the voice prefilter and one consumer type. No epic parent: #1342 is a pure refactor whose constraints forbid protocol and signature changes, and this issue makes a ruled breaking type change. priority: p2 kept, equal to its blocker #1362. agent-ready together with blocked.
Activity
schlessera commentedon Nov 3, 2026
Triage 2026-11-03: the two open questions now carry options and recommendations in the body. For voice-owned frames, keep the prefilter and mark the entries "consumed upstream" with a proving test. For
pong, keep it with a marker unless its union is internal.needs: decision.schlessera commentedon Nov 3, 2026
Decision (maintainer, 2026-11-03): Q1 A — move voice-owned frame handling (
dialogue_history,tool_resolution, the sixconversation_*) into handler-map entries backed by the conversation client, so the map is the only router; voice regression proof is part of the acceptance criteria. Q2 A — removepongfrom the consumer-facing frame union.Contract check:
ServerMessage(withServerPong) is exported from the public@schlessera/brain-ui-sdk/protocolentry point and keys the public./clienthandler type (packages/ui-sdk/src/client/ws-client.ts:79-82), so droppingpongfrom the consumer union is a breaking type-level contract change. Addedcontractandbreaking; the body's Contract impact gives the breaking treatment (pre-1.0 minor,breakinglabel, changeset naming the break). The wire frame and the parser's union keeppong. This comment is the ruling the breaking change requires. Removedneeds: decision;agent-ready.schlessera commentedon Nov 3, 2026
Triage 2026-11-03 (second pass): updated the drifted citations to main
d990c0ab3(protocol.ts:796/:817,connection.ts:50-55). #3390 is onepic/1342-turn-path-split, not main. On main,retry_receipt,ask_answer_receiptandsession_queueare still no-ops in the same files this issue edits, so #1362 is now the declared blocker. Addedchat_retired(#3231's deliberately inert entry) to out of scope. Milestone 0.45.0. No epic parent: #1342's constraints allow only pure refactors with no protocol or signature change, and this issue makes a ruled breaking type change.priority: p2kept, equal to #1362.agent-readyandblocked.schlessera commentedon Nov 3, 2026
Unblocked: every
Blocked byissue here is closed. #1362 and #2515 closed when epic #1342 batch 1 landed on main in #3520 (merge9805f52fd).schlessera commentedon Nov 15, 2026
Claimed for implementation. Claim token:
claim-87a6ac46. Branch:refactor/3389-handler-map-voice-frames.path overlap on protocol.ts/ws-client.ts with many open drafts; no closure collision known
test(ci): list the handler-map type assertions as a compile-only unit…
CONTRACT: refactor(ui-react,ui-sdk): route voice-owned frames through…
schlessera commentedon Nov 16, 2026
Merged in #4067 as
087ffdd5ethrough the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.