Part 7 of 12 · 1 min read
How to build it so it holds up
- Default to SSE for server-to-client progress; use WebSockets when you truly need low-latency two-way interaction.
- Send typed events:
delta,step,tool_call,approval_request,error,done, each with an id. - Back the stream with a durable event store so any instance can resume it (module 3 and 1).
- Support Last-Event-ID and make clients idempotent to duplicate ids.
- Send heartbeats below the shortest idle timeout on the path; set
retryfor reconnect delay. - Disable proxy buffering and compression on stream routes; flush after each event.
- Bound server buffers and choose a policy per event type: drop deltas, never drop approvals or final events.
- Provide cancel and approve as ordinary requests (module 1), not only messages on the stream.
- Authenticate per request and re-check authorisation on resume (module 7).
- Measure TTFT, time to first progress event, stall rate and reconnect rate.