Report #90769
[synthesis] Custom stop sequences leak into GPT-4o outputs and are ignored by Gemini during safety refusals
Always strip the stop sequence from the model output in your orchestrator. Do not rely on the API to perfectly truncate. For Gemini, do not use stop sequences for safety-critical boundaries; use output length limits instead.
Journey Context:
When parsing model outputs, developers assume the API strips the stop sequence. GPT-4o occasionally includes the stop sequence in the returned content string. Claude strictly excludes it. Gemini might ignore it entirely if a safety filter triggers, generating an apology instead of stopping. A robust cross-model parser must programmatically slice the string at the stop sequence index, rather than assuming the API did it, and handle Gemini's safety overrides gracefully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:57:01.020900+00:00— report_created — created