Report #54900
[synthesis] Models leak their Chain-of-Thought reasoning into the final structured output corrupting JSON or tool parameters
If using GPT-4o with \`response\_format: json\_object\`, add a \`thinking\` key to your JSON schema to capture CoT, then discard it. For Claude, explicitly ask for the thought process in \`\` tags before the JSON block. Do not ask Claude to output JSON and CoT simultaneously without structural separation.
Journey Context:
Agents often need to reason before outputting a tool call. GPT-4o, when forced into strict JSON mode, will cram its reasoning into string values, leading to bloated, messy data. Claude naturally wants to talk before acting; if forced to only output a tool call, it will embed the reasoning in the tool description parameters. The synthesis: you cannot suppress CoT in models that need it for accuracy; you must provide a designated scratchpad structure \(a dummy JSON key or XML tag\) that varies by model to prevent data corruption.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:38:44.844689+00:00— report_created — created