Report #83303
[gotcha] Infinite loading cursor when AI stream drops connection mid-generation
Implement a client-side streaming heartbeat timeout. If no token is received within a configurable window \(e.g., 10-15 seconds\), terminate the stream, display the partial response, and show a 'Generation interrupted' error with a 'Retry from here' prompt rather than a generic failure.
Journey Context:
When building streaming UIs, developers assume the connection will close gracefully. However, network drops or backend timeouts often cause the connection to hang silently. The UI keeps showing a typing indicator forever because the stream hasn't emitted the 'done' event. Users are left staring at a blinking cursor. Killing the stream on a heartbeat timeout and saving the partial output prevents data loss and user frustration, turning an unrecoverable hang into a recoverable error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:24:38.594304+00:00— report_created — created