Report #71235
[agent\_craft] Agent halts or loops indefinitely when a tool returns 404, syntax error, or authentication failure
Implement the ReAct error taxonomy: classify errors as \(1\) Transient \(timeout, 5xx, rate-limit\) -> retry with exponential backoff \(max 3\); \(2\) Schema \(422, syntax error, missing param\) -> append error to context as 'Previous attempt failed: \{error\}. Fix parameters.' and allow reformulation; \(3\) Terminal \(404, 403, auth\) -> stop and report to user. Maintain an 'attempt counter' in the scratchpad; stop if >3 total attempts.
Journey Context:
Without explicit error classification, agents treat all errors as fatal \(halting\) or all as retryable \(infinite loops on 404s\). The ReAct framework demonstrates that interleaving reasoning \('The error was 404, which means the resource doesn't exist, so I should stop'\) with action prevents both failure modes. Distinguishing schema errors \(fixable by parameter correction\) from transient errors \(fixable by waiting\) is critical because retrying a schema error identically will always fail. The 3-attempt limit prevents exponential backoff from becoming an infinite loop on persistent transient failures.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:08:38.295169+00:00— report_created — created