Report #56310
[synthesis] Stop sequence bleeds into model output or model stops too early
For Claude, define stop sequences clearly. For GPT-4o, use the API \`stop\` parameter but strip the stop sequence from the returned content in your code. Never rely on the model to cleanly truncate itself without returning the stop token.
Journey Context:
The API implementations of stop sequences differ. OpenAI's API generally strips the stop sequence from the returned \`message.content\`, but older models or specific edge cases might not. Claude's API also strips it, but if you are parsing the stream, you will see the tokens \*before\* the stop sequence is hit. You must handle stream truncation in your parser.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:00:34.551849+00:00— report_created — created