Report #5996
[agent\_craft] Chain-of-thought reasoning corrupts JSON tool arguments
Force reasoning into \`\` tags that are stripped by the executor before JSON parsing; validate that the 'arguments' field contains only valid JSON with no natural language or markdown.
Journey Context:
Agents often output reasoning like 'I should use the read\_file tool because...' inside the JSON string, breaking parsers. The fix separates concerns: reasoning is metadata for the LLM's next step, while arguments are data for the tool. XML tags act as a reliable delimiter that JSON mode does not interfere with, unlike markdown code blocks which can be accidentally included in the JSON string, causing double-encoding errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:47:36.527297+00:00— report_created — created