You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How does an answer get from the server to a browser, live, to however many clients are watching?
Provider seam design already fixed what the loop produces: an AsyncIterable normalizing to delta / done{usage} / error{kind}, where transient errors retry internally and auth/refusal surface immediately. App shell and stack carried that to the renderer over Electron IPC — a single consumer on the same machine, with no connection to lose. Neither assumption holds now.
Blocked on The answer log, which fixes what a joining client can be handed.
Decide:
Transport. Server-Sent Events or WebSocket. SSE is one-directional, reconnects for free with Last-Event-ID, and survives proxies; WebSocket costs more but is needed if a client ever sends anything upstream — which turns on whether The control surface puts controls in the client. Decide the transport and say what would force the other choice.
The event vocabulary. How Provider seam design #5's delta/done/error map onto the wire, plus whatever the client needs that the seam doesn't emit: a new-answer boundary, the interrupt-and-replace signal from The output window, and the loop's own state — Cost control's status-pill vocabulary (throttled, paused (budget), paused (runaway guard)) has to reach the client somehow.
What a joining client receives. The settled constraint is that it loads previously logged answers. Decide how many, in what order, and how the boundary between replayed history and the live stream is marked — including the case where a client joins mid-answer, with a partial answer already streaming.
Fan-out. N simultaneous clients on one loop. Whether they all see identical state, what a slow or wedged client costs the others, and backpressure — the loop must not stall because a phone went to sleep.
Reconnect and resume. What a client does after a dropped connection, whether it resumes from a cursor or refetches, and how it avoids re-rendering an answer it already has.
Idle behaviour. Keepalives, and what the server does with a connection that's been silent for hours — a phone on a lock screen is the normal case, not the edge case.
Deliverable: the wire protocol — transport, event shape, connect/replay/resume semantics, and fan-out rules — specific enough that The web client can be built against it without further decisions.
Question
How does an answer get from the server to a browser, live, to however many clients are watching?
Provider seam design already fixed what the loop produces: an
AsyncIterablenormalizing todelta/done{usage}/error{kind}, where transient errors retry internally andauth/refusalsurface immediately. App shell and stack carried that to the renderer over Electron IPC — a single consumer on the same machine, with no connection to lose. Neither assumption holds now.Blocked on The answer log, which fixes what a joining client can be handed.
Decide:
Last-Event-ID, and survives proxies; WebSocket costs more but is needed if a client ever sends anything upstream — which turns on whether The control surface puts controls in the client. Decide the transport and say what would force the other choice.delta/done/errormap onto the wire, plus whatever the client needs that the seam doesn't emit: a new-answer boundary, the interrupt-and-replace signal from The output window, and the loop's own state — Cost control's status-pill vocabulary (throttled,paused (budget),paused (runaway guard)) has to reach the client somehow.Deliverable: the wire protocol — transport, event shape, connect/replay/resume semantics, and fan-out rules — specific enough that The web client can be built against it without further decisions.
Generated by Claude Code