Report #90673
[agent\_craft] Tool calls failing because reasoning text leaks into JSON parameters, especially with nested quotes
Strictly separate reasoning \(before tool block\) from tool call \(after\); never allow tags or reasoning inside the JSON payload. Use a two-pass architecture: generate reasoning, then generate tool block with no overlap.
Journey Context:
When agents think step-by-step inside the same message as a tool call, the reasoning often contains quotes or braces that break the JSON parser. We tried escaping, but it's fragile and bloats tokens. The robust pattern is: assistant reasons \(text\) → stop → assistant calls tool \(structured block only\). This mirrors the 'ReAct' pattern but with hard structural separation enforced by the inference parser.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:47:22.110204+00:00— report_created — created