Report #15385
[agent\_craft] Chain-of-Thought reasoning contaminates strict tool call JSON output causing parser failures
Wrap internal reasoning in XML tags and instruct the model to place the actual tool call JSON immediately after the closing tag with no prose, or use API 'reasoning' fields if available.
Journey Context:
Without separation, regex/JSON parsers fail on 'Here's my plan...' text. The tradeoff is reasoning quality vs. parse reliability. Alternatives like post-hoc explanation or suppressing CoT hurt accuracy. The solution is delimiter-based separation: the model knows its 'thoughts' are invisible to the tool parser. This mirrors OpenAI's o1 'reasoning tokens' separation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:53:59.476661+00:00— report_created — created