Report #86687
[synthesis] Agent outputs perfectly formatted JSON that strictly adheres to the tool schema, but the semantic content is completely hallucinated or logically disconnected from the previous step, because the model prioritized structural compliance over reasoning
Decouple reasoning from formatting by requiring the agent to output a natural language 'Chain of Thought' before the structured tool call, and enforce strict schema validation after parsing.
Journey Context:
When using strict JSON mode or function calling, LLMs often sacrifice reasoning to ensure the brackets close correctly. The agent appears to be working because the tool calls are valid, but the actual actions are nonsensical. By forcing the reasoning step to happen in plain text before the structured output, the model can think without the cognitive load of JSON formatting, leading to semantically correct tool calls.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:05:37.059158+00:00— report_created — created