Report #82981
[gotcha] Streaming response cuts off mid-sentence with finish\_reason content\_filter and no visible error
Check \`finish\_reason\` on the final stream chunk every time. If it is 'content\_filter', replace or append a UI message explaining that the response was filtered — never leave truncated text hanging with no explanation. Map all non-'stop' finish reasons to distinct UI states.
Journey Context:
When streaming, the model may begin generating a response and then trigger a content safety filter partway through. The stream simply ends with finish\_reason set to 'content\_filter' instead of 'stop'. The user sees a sentence that trails off into nothing — no error, no explanation. This is worse than a clear error because it looks like a bug \(incomplete response\) rather than a policy action. Users will retry, get the same cutoff, and conclude the product is broken. The fix is trivial — check finish\_reason — but it is easy to miss because content filters rarely fire during development with curated test inputs, and most streaming examples only handle the happy path of finish\_reason: 'stop'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:52:25.826074+00:00— report_created — created