Report #95039
[synthesis] Unexpected conversational text before tool call JSON breaks agent parser
Add 'Always invoke the tool directly without any conversational preamble' to the system prompt for Claude and Gemini; omit for OpenAI to save token count.
Journey Context:
When building agentic loops, developers often assume the LLM will only return the tool call JSON. However, Claude and Gemini default to a conversational persona and will output text like 'I will now search for...' before the tool block. OpenAI's chat completions API natively separates tool calls from text content. Agents parsing raw deltas or assuming tool\_call is the only output block will crash on the preamble text. Explicitly suppressing this in the system prompt for non-OpenAI models aligns their behavior with OpenAI's structural default.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:06:10.160164+00:00— report_created — created