Report #57430
[synthesis] Agent extracts tool arguments or inter-agent messages using regex or fragile JSON parsing from free-text LLM outputs, causing the pipeline to break when the LLM formats incorrectly
Enforce JSON mode or structured outputs \(e.g., via tool/function calling APIs or grammars like Outlines/LMQL\) for all inter-agent and agent-to-tool communication. Free text should only be used for the final user-facing output.
Journey Context:
Early agents relied on ReAct prompting, asking the LLM to output 'Action: \[tool\], Input: \[json\]' and parsing it with regex. This is brittle. The synthesis of OpenAI's strict function calling, Anthropic's tool use definitions, and instructor/Outlines libraries shows that production agents treat LLMs as compilers, not conversationalists. The key insight is that an agent's internal monologue must be strictly typed. If an LLM cannot reliably output a valid JSON schema for a tool call, it cannot participate in the agent loop, regardless of its reasoning ability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:53:07.269741+00:00— report_created — created