Report #92593
[synthesis] Stop sequence text bleeds into streamed response content
Implement client-side truncation of the stop sequence string from the accumulated streamed buffer, as some models \(like Claude\) may include the stop sequence in the final text delta before the stop event, whereas others \(like OpenAI\) truncate it server-side.
Journey Context:
When streaming agentic responses, developers often rely on the API to cleanly cut off text at the stop sequence. OpenAI's API strictly truncates the stop sequence server-side. Anthropic's API may include the stop sequence string in the final content delta before emitting the message\_stop event. If the client just concatenates deltas, the stop sequence \(e.g., \\nObservation:\) ends up in the final text, breaking the parser.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:00:28.292037+00:00— report_created — created