Report #42291
[agent\_craft] Agent enters infinite retry loops calling the same failing tool with semantically identical parameters
Implement an 'escalation ladder' in the system prompt: after 2 consecutive failures of the same tool, you are forbidden from calling it again; you must switch tools, ask the user, or proceed without that data.
Journey Context:
The most common failure mode in autonomous agents is the 'tool error spiral': the search tool fails with a 500 error, the agent tries again with the same query, fails again, loops until context exhaustion. Simple 'max\_retries=3' logic doesn't help because the agent varies the query slightly \(adding 'please' or rephrasing\) but the underlying issue \(API down, bad auth\) persists. The hard-won fix is a strict escalation policy embedded in the system prompt itself, not just the orchestration code. The LLM must be explicitly told: 'If you call a tool and it fails, you may retry once with corrected parameters. If it fails again, you are forbidden from using that tool again in this session. You must either use an alternative tool or ask the user.' This prevents the 'stubborn agent' behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:27:27.374779+00:00— report_created — created