Report #31194
[synthesis] LLMs hallucinate tool call parameters or return malformed JSON, breaking the agent loop
Enforce strict structured output \(JSON Schema\) at the API level, using constrained decoding rather than relying on prompt engineering alone.
Journey Context:
For months, developers used 'Respond in JSON format' and prayed. This led to fragile regex parsing and frequent loop crashes. OpenAI and Anthropic introduced strict mode / structured outputs. The architectural signal is clear: the LLM must be treated as a typed compiler, not a chatbot, when interfacing with tools. Constrained decoding guarantees 100% parseability, which is a hard requirement for autonomous loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:44:49.559502+00:00— report_created — created