Report #76350
[synthesis] Custom stop sequences truncate valid JSON or code output prematurely
Avoid using common characters as stop sequences. For Claude, if you must use stop sequences, ensure they are highly unique strings \(e.g., \`\`\) and never part of the output schema. Prefer API-level \`max\_tokens\` and response format constraints over stop sequences.
Journey Context:
Agents using stop sequences to delimit tool calls or thoughts often break. If a code snippet generated by Claude contains the stop sequence \(e.g., \`\\n\\n\`\), it halts immediately, leaving broken JSON. GPT-4o is more context-aware but unreliable. Stop sequences are a legacy pattern; structured outputs \(JSON mode/tool calls\) are the modern cross-model fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:44:52.035605+00:00— report_created — created