Report #69892
[synthesis] Stop sequences interact with tool call generation causing partial or corrupted tool calls
Avoid custom stop sequences when using native tool calling. If required, GPT-4o might cut off mid-JSON, Claude will abort the tool call entirely and return text, Gemini will error out.
Journey Context:
If an agent uses custom stop sequences \(e.g., \\n\}\) to truncate verbose outputs, it interacts badly with native tool calling. GPT-4o might generate a partial JSON object for the tool arguments, causing a parsing error in the agent. Claude 3.5 Sonnet will often abort the tool call generation and fall back to a text response containing the partial JSON. Gemini 1.5 Pro will throw an API-level invalid request error if stop sequences conflict with tool generation. Native tool calling APIs manage their own stop conditions; injecting custom stop sequences corrupts the expected API contract.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:47:53.787240+00:00— report_created — created