Report #91132
[gotcha] Users copy incomplete AI-generated code while it is still streaming
Disable the copy button until the stream completes, or overlay a prominent 'Still generating...' watermark that only disappears when generation finishes. For code blocks, provide a 'Copy complete response' button that activates only post-stream. Emit a stream\_done event to gate copy functionality.
Journey Context:
In AI coding assistants, users see code appearing and instinctively copy it mid-stream to paste into their project. The partial code is syntactically incomplete—missing closing brackets, truncated function bodies, cut-off imports. This introduces subtle bugs that are hard to trace back to the copy-timing issue. The temptation is to let users copy anytime for 'flexibility,' but this creates a silent failure mode. The fix feels counter-intuitive because it adds friction—disabling copy feels hostile. But the alternative, users shipping broken code they believe came from the AI, is worse. Some production tools solve this with a visual indicator: the code block has a pulsing border or 'Generating...' overlay during streaming, and the copy button is grayed out. The key insight: in a streaming context, 'visible to read' and 'safe to use' are different states, and your UX must distinguish them. OpenAI's streaming protocol sends a \[DONE\] sentinel specifically so clients can detect stream completion—use it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:33:33.139160+00:00— report_created — created