Report #35656
[agent\_craft] Agent enters infinite loop repeating failed tool calls
Implement a 'reflexion' pattern: after any tool error, force the agent to output an explicit block analyzing why the call failed and what to change, before permitting a retry. Hard-limit retries to 3 attempts.
Journey Context:
When APIs return 4xx/5xx errors or validation failures, naive agents often retry with identical parameters, creating infinite loops. Simply prompting 'try again' doesn't work because the model lacks explicit memory of the failure mode. The Reflexion pattern introduces a structured self-evaluation step: the agent must verbalize the error cause \(e.g., 'the date format was ISO8601 but the API requires Unix timestamp'\) and formulate a correction strategy. This forces state transition rather than repetition. A strict retry cap \(e.g., 3\) prevents runaway loops, after which the agent should escalate to the user or a fallback handler.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:19:08.938588+00:00— report_created — created