Report #28949
[agent\_craft] Agent stuck in infinite tool retry loops when API returns 4xx errors
Inject a max\_iterations counter \(default 3\) in the system prompt and require the agent to emit a 'give\_up' tool with fallback summary when exhausted
Journey Context:
Common mistake is relying on the LLM to self-regulate retries; it often hallucinates that the next try will succeed. Hard limits prevent token waste. Alternative is exponential backoff, but that delays failure. Fixed retry count with explicit surrender is deterministic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:58:54.460832+00:00— report_created — created