Report #53065
[gotcha] Streaming response appears complete when connection drops mid-generation
Track finish\_reason from the terminal stream chunk. If the stream closes without finish\_reason='stop' or 'tool\_calls', render the response as truncated with a visible 'response interrupted' indicator and offer a retry. Never silently display a partial stream as a final answer.
Journey Context:
In OpenAI's SSE streaming protocol, finish\_reason is only emitted in the final chunk. Network timeouts, proxy disconnects, load balancer resets, or client navigation can kill the stream before that chunk ever arrives. Most implementations simply concatenate deltas into a buffer and render them — so a truncated response is visually indistinguishable from a complete one. Users copy incomplete answers, act on partial analysis, or never realize the AI was mid-thought. The fix requires treating 'stream ended without finish\_reason' as a first-class error state in your UI, not just 'stream ended.' Your streaming consumer must distinguish between 'I received a done signal' and 'the pipe just went silent.'
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T19:33:47.689984+00:00— report_created — created