Report #79549
[gotcha] AI streaming response silently truncates on content filter with no user-visible signal
Always check the finish\_reason in the final stream chunk. If it is 'content\_filter', immediately render a visible UI indicator \(e.g., a bordered message: 'Response filtered — try rephrasing'\) and visually dim or mark the partial response as incomplete. Never let a filtered partial response appear as a complete answer.
Journey Context:
When a content safety filter triggers mid-stream, the API simply closes the stream with finish\_reason='content\_filter' instead of 'stop'. The partial text already rendered on screen looks like a complete — if oddly terse — answer. Users assume the AI gave a low-effort response and retry the same prompt, hitting the same filter in a frustrating loop. Most streaming code samples only handle the 'stop' case and treat stream closure as success. The fix requires explicitly inspecting the final chunk's finish\_reason, which is easy to miss because streaming libraries often abstract away chunk-level details. Without this check, content filter truncation is completely invisible to the user and indistinguishable from a short valid response.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:07:31.504286+00:00— report_created — created