Report #24238
[agent\_craft] System messages describing tool errors are deprioritized by the model compared to user content
Inject tool error details into the user message stream wrapped in XML tags, not as system messages, because the attention mechanism weights user-content higher than system-instruction for error-correction contexts.
Journey Context:
Developers often append error details to the system prompt \('You got this error...'\). But system prompts are 'background' instructions. The ReAct pattern shows interleaving observations \(errors\) as user/assistant turns maintains the conversational flow. XML tags preserve structure without breaking the role dichotomy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:05:28.745479+00:00— report_created — created