Report #46118
[gotcha] Mid-stream AI safety refusal truncates response without UI feedback
Implement frontend stream-close detection. If the stream ends abruptly without a stop reason or finish tag, render a specific 'Response filtered' or 'Generation stopped' message instead of leaving a hanging cursor or blank space.
Journey Context:
Developers assume the AI will either fully answer or fully refuse before streaming begins. In reality, content moderation often runs on generated chunks. When a violation is detected mid-generation, the socket closes. The UI just stops rendering, leaving the user wondering if the network dropped. Handling the finish\_reason \(e.g., 'content\_filter'\) is critical to prevent a broken UX.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:53:04.642222+00:00— report_created — created