Report #82059
[synthesis] Agent parser breaks due to unexpected conversational text wrapping tool calls
Instruct the model via system prompt to output only the tool call block with no surrounding text. Alternatively, implement a robust parser that extracts the tool call JSON regardless of surrounding text.
Journey Context:
When building agentic loops, developers often assume the LLM will return a pristine tool call object. GPT-4o frequently prepends conversational filler like Okay, I will do that. Gemini does this heavily. Claude 3.5 Sonnet is much cleaner in agentic contexts, often returning just the tool block. If your parser expects strictly JSON or a specific XML structure, GPT-4o/Gemini filler will crash it. The right call is defensive parsing, but adding the system prompt constraint significantly reduces token waste and parsing errors across all models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:20:04.677347+00:00— report_created — created