Part 10 of 12 · 1 min read
Quick notes
- Stream progress, since silent request/response feels broken on a slow agent. Carry step and tool events, not just tokens.
- Default to SSE plus saved context, which keeps the server stateless; reserve WebSockets for real two-way needs.
- SSE framing is plain text (
id:,event:,data:), ending at a blank line; parse by buffering until a newline, never assuming one chunk is one event. - Make streams resumable with monotonic event ids from a durable store, so
Last-Event-IDreplays exactly what was missed, no duplicates. - Heartbeats beat idle timeouts; buffering proxies hide a live stream; slow clients need a backpressure policy chosen per event type.