Report #46490
[agent\_craft] Agent fails to parse tool outputs or distinguish between reasoning and final answers
Enforce strict XML tag boundaries like ... and ... in the system prompt and parse outputs with regex or XML parsers rather than looking for 'Final Answer:' strings.
Journey Context:
Early ReAct implementations used natural language delimiters like 'Thought:' and 'Action:' or 'Final Answer:'. These are brittle because the model may generate those phrases inside code blocks or user-facing content, causing parse failures. XML tags \(popularized by Anthropic's Claude documentation and the 'XML tagging' pattern\) provide unambiguous boundaries because they can be forbidden from appearing inside the content \(or escaped\). Additionally, using closing tags like allows streaming parsers to know when reasoning ends and final output begins, enabling UI patterns that hide thinking steps. This is strictly more robust than newline-based parsing or keyword matching.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:30:24.934179+00:00— report_created — created