Report #76146
[synthesis] API-level stop sequences truncate tool call JSON or conflict with native tool use blocks
Avoid custom stop sequences when tool calling is enabled; rely on the model's native tool-use stop tokens and structured output modes instead of character-level truncation.
Journey Context:
Developers sometimes use API-level stop sequences to prevent models from rambling. However, when tool calling is active, this creates cross-model conflicts. GPT-4o's structured outputs ignore custom stop sequences, but standard models might truncate mid-JSON. Claude's stop sequences can preempt the model from opening a tool\_use block entirely, resulting in conversational text instead of a tool call. Gemini often ignores stop sequences if it feels the tool call is incomplete. Relying on character-level stop sequences in agentic workflows is an anti-pattern that breaks tool parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:24:15.496769+00:00— report_created — created