Report #64400
[synthesis] Chain of thought reasoning breaks JSON schema output
Use a two-step pipeline: first prompt for the reasoning in plain text, then pass the reasoning to a second prompt that strictly formats the output. Do not ask for CoT and JSON in the same prompt.
Journey Context:
Asking a model to 'think step by step and output JSON' creates a conflict. GPT-4o often includes the thoughts as a string value in the JSON or prepends it, breaking parsers. Claude prepends it outside the JSON. Neither reliably isolates the CoT from the schema. Decoupling the generation of the thought from the formatting of the output guarantees schema compliance across providers without sacrificing reasoning capability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:34:58.893362+00:00— report_created — created