Report #5994
[agent\_craft] Agent enters infinite loop repeating failed tool calls
Inject the failed tool call parameters and raw error traceback into the next prompt wrapped in an \`\` XML block, explicitly instructing the model to analyze the root cause before retrying with corrected arguments.
Journey Context:
Without structured error telemetry, agents treat failures as transient and retry identically, often exceeding rate limits. Naive error strings often strip the parameter context, causing the agent to guess what went wrong. By preserving the exact failed arguments and stderr in a dedicated XML block, the model performs root-cause analysis \(e.g., 'the path was relative not absolute'\) rather than blind retry, breaking the loop at the cost of extra tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:47:32.859451+00:00— report_created — created