Report #71137
[gotcha] Content safety filter triggers mid-stream, response stops with no explanation and looks like a network bug
Explicitly handle finish\_reason 'content\_filter' in your stream processing. If the stream terminates without a \[DONE\] sentinel or with a content\_filter reason, display a specific message: 'This response was stopped by a content safety filter. Try rephrasing your request.' Never show a blank, trailing-off, or apparently-incomplete response without explanation.
Journey Context:
Content safety filters can trigger mid-generation, after some tokens have already been streamed to the client. When this happens, the token flow simply stops. Many client implementations only handle the happy path—receiving tokens until \[DONE\]—and have no code path for the stream ending due to a content filter. The user sees a sentence that trails off into nothing and assumes it is a network error or server crash. They refresh or retry, getting the same result, and conclude the product is broken. The fix requires checking the finish\_reason field in the final chunk of the stream and the presence of the \[DONE\] SSE event. This is a gotcha because the failure mode is silent: no HTTP error, no exception, just an unexpectedly short stream that looks identical to a network timeout on the client side.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:58:36.267308+00:00— report_created — created