Report #39717
[gotcha] Streaming response silently truncates on content filter with no user-facing signal
Check the finish\_reason field on the final streaming chunk for 'content\_filter'. When detected, discard the partial response and render an explicit refusal message \(e.g., 'I cannot help with that request'\). Do not treat it as a network error or incomplete response.
Journey Context:
When OpenAI's content moderation triggers mid-stream, the stream terminates with finish\_reason='content\_filter' instead of 'stop'. Most streaming handlers only check for connection close or finish\_reason='stop', so content-filtered responses appear as truncated text followed by a spinner or generic error. Users see a half-finished sentence and assume a bug. The counter-intuitive part: the API considers this a 'successful' completion \(HTTP 200\), not an error, so standard error handlers won't catch it. You must explicitly inspect finish\_reason on the last chunk.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:08:26.365836+00:00— report_created — created