Report #74133
[agent\_craft] Markdown code blocks for tool I/O causing delimiter collision and parsing failures
Wrap all tool inputs and outputs in strict XML tags \(, \) rather than markdown fences to eliminate ambiguity when tool content contains code blocks
Journey Context:
Early agent implementations used markdown \`\`\`json blocks to delimit tool calls, but this fails when tool arguments or results contain markdown themselves \(e.g., generating a README\). This creates parser ambiguity: is the \`\`\` inside the argument or closing the block? XML tags solve this by using distinct tag names that explicitly denote semantic roles, and they nest cleanly. This pattern was adopted after observing that markdown parsing failures were the primary source of retry loops in early Claude and GPT-4 function calling implementations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:01:42.059652+00:00— report_created — created