Report #82249
[gotcha] Stream fails mid-response and UI displays partial output as if it were complete
Track stream completion explicitly — a response is only 'complete' when you receive the final chunk with finish\_reason or the \[DONE\] sentinel. If the stream disconnects or errors before that, show an error state with a retry option. Never silently treat a partial stream as a finished response.
Journey Context:
Server-sent events streams can terminate mid-response due to rate limits \(429\), server errors \(500/503\), network timeouts, or load balancer disconnects. When this happens, the client has received some chunks but no final chunk with finish\_reason. Many implementations do not distinguish between 'stream ended naturally' and 'stream broke' — they just stop appending tokens and render whatever they have. The user sees a response that looks done but is actually incomplete. This is especially dangerous for code generation where truncated code is syntactically invalid but might not obviously look wrong — users copy-paste broken code. The fix requires explicit stream lifecycle tracking: maintain a 'streaming' state that only transitions to 'complete' on finish\_reason or \[DONE\], and transitions to 'error' on unexpected disconnect.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:39:07.908358+00:00— report_created — created