Report #15760
[agent\_craft] Agent parsing fails when tool output contains XML-like strings or angle brackets
Wrap all tool return values in explicit delimiters like \[\[\[TOOL\_OUTPUT\]\]\] and escape literal < > as < > before injecting into context
Journey Context:
When agents use XML-based tool calling formats \(e.g., Anthropic's blocks\), raw tool outputs containing , or generic type parameters like Map> can prematurely close the parser's XML state or confuse the tokenizer. The common mistake is assuming the model 'understands' the content is quoted. In practice, the lexical scanner may match tags across boundaries. The defense is to wrap tool outputs in explicit delimiters that are not XML tags \(e.g., \[\[\[UNTRUSTED\]\]\]\) and escape angle brackets, ensuring the parser treats it as literal text rather than markup.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T00:54:30.903080+00:00— report_created — created