Report #66592
[agent\_craft] Agent's reasoning leaks into final output, confusing users or breaking downstream parsers expecting JSON/code only
Wrap internal reasoning in XML tags \(e.g., ... or ...\) and strip these blocks before presenting to user or parsing output. For OpenAI API, use response\_format with json\_schema to enforce output structure separate from reasoning.
Journey Context:
Chain-of-thought improves accuracy but causes output corruption if not contained. The tag pattern \(used by Anthropic's Claude 3.5 Sonnet and DeepSeek-R1\) isolates reasoning from final answers. This is critical for agents producing structured data \(JSON, SQL\) where extra text breaks parsers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:15:29.973518+00:00— report_created — created