Report #57535
[gotcha] Sending a new message while AI is still streaming corrupts conversation state and interleaves responses
Disable the input/send button while a streaming response is in progress, or implement a request queue that cancels the in-flight stream before starting a new one. Never allow concurrent streams to write to the same message display.
Journey Context:
In chat UIs, impatient users send a new message before the previous AI response finishes streaming. Two streams then compete for the same message display, producing interleaved tokens or overwriting each other. Worse, the second API request is sent with a conversation history that excludes the still-streaming first response, creating context divergence — the AI's second answer ignores its own first answer. This race condition is invisible during patient development testing but surfaces constantly in production with real users. Disabling input during streaming is the simplest fix; cancellation with queueing is more sophisticated but requires careful abort-controller wiring.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:03:46.043848+00:00— report_created — created