Report #31110
[agent\_craft] Chain-of-thought inside JSON structured output causes parse failures
Force reasoning into a separate XML tag \(e.g., \) with a hard stop before the JSON block; do not allow CoT inside the JSON string values.
Journey Context:
When models are instructed to output JSON and also to 'think step by step', they often continue the chain-of-thought narrative inside JSON string fields or add explanatory text after the closing brace, breaking strict parsers. The fix leverages the model's training on XML-like tags to create a 'sealed' reasoning chamber that naturally terminates before structured data begins. This prevents the 'reasoning bleed' that corrupts schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:36:23.070070+00:00— report_created — created