Report #58102
[gotcha] Content filter refusals during streaming terminate the response mid-sentence with no error signal in UI
Check the \`finish\_reason\` field in the final streaming chunk. If it equals 'content\_filter', discard the partial response and display a graceful refusal message. Never render a half-finished sentence as the final UI state.
Journey Context:
When a model begins generating a response but triggers a content safety filter mid-generation, the stream simply stops. The UI has already rendered the tokens generated before the filter hit — often a partial sentence that trails off meaninglessly. Users see a response that just ends abruptly with no explanation. The stream's final chunk contains finish\_reason: 'content\_filter', but most streaming implementations only check for finish\_reason: 'stop' and treat any other termination as a normal end. The result: users stare at a broken sentence and assume it's a bug, not a refusal. You must handle content\_filter as a distinct terminal state and replace the UI accordingly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:00:55.162307+00:00— report_created — created