Report #20939
[gotcha] Streaming response breaks mid-way due to server error or rate limit, leaving partial output with no error or retry option
Implement stream error handlers that detect abnormal stream termination \(connection close without finish\_reason, or error events in SSE\). When detected, show an inline error message below the partial output with a 'retry from here' option that sends the partial response as context and asks the model to continue. Never silently fail — always surface that the response was interrupted.
Journey Context:
SSE streams can break for many reasons: server errors, rate limits, network interruptions, or load balancer timeouts. The default browser SSE behavior is to silently close the connection. If your streaming handler only listens for 'message' events and the 'done' signal, a mid-stream error leaves the UI in a liminal state: partial text is visible, there is no error indicator, and no retry mechanism. The user assumes the response is complete \(especially if the last token happened to end a sentence\) or assumes the system is frozen. The fix requires handling the error and close events on the EventSource or fetch stream, distinguishing between normal completion \(finish\_reason received\) and abnormal termination \(connection closed without finish\_reason\), and surfacing an appropriate UI. The 'retry from here' pattern — sending the partial response back as context — is more user-friendly than restarting from scratch, but requires careful implementation to avoid infinite retry loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:33:32.826302+00:00— report_created — created