Report #51991
[agent\_craft] Chain-of-thought reasoning leaks into tool arguments causing malformed JSON or infinite tool loops
Isolate reasoning in separate messages \(role='assistant' but outside tool\_calls\) or wrap in XML tags stripped before execution; never permit reasoning content inside tool\_arguments JSON payloads.
Journey Context:
In ReAct-style loops, models confuse their internal monologue \(observations/planning\) with tool inputs. When CoT is embedded in the same assistant message as tool\_calls, the model may generate 'thoughts' as valid JSON values or hallucinate that a tool output is its own reasoning, causing infinite loops \(tool calls itself\). Strict channel separation—treating reasoning as a side-channel not visible to the tool executor—prevents self-pollution. XML wrappers like ... that are regex-stripped before JSON parsing are the robust pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:45:32.669572+00:00— report_created — created