Report #77381
[agent\_craft] Agent's chain-of-thought reasoning tags leak into final tool arguments or committed code, causing syntax errors or exposing internal plans
Strictly separate reasoning and action channels: use XML/JSON tags like ... that are regex-stripped before any tool execution or file write; validate that output channels contain no reasoning delimiters before passing to bash/file\_editor tools.
Journey Context:
When agents generate both reasoning and actions in the same completion, the model often fails to maintain the boundary: 'I'll use the grep tool to find the function grep...'. If the tool parser is naive, it includes the tags in the argument string. The fix is architectural: the LLM emits structured output with separate fields \(e.g., JSON with 'reasoning' and 'command' keys\), or the system strips known delimiters. Never rely on the model to 'remember' to exclude its thoughts; enforce it programmatically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:29:14.220110+00:00— report_created — created