Report #87647
[agent\_craft] Agent getting stuck in infinite tool retry loops or failing silently on tool execution errors
Implement explicit error state tracking in the ReAct scratchpad: after a tool error, force a 'reflection' step that analyzes the error category \(transient/permanent, auth/not-found\) before deciding to retry, skip, or escalate
Journey Context:
Standard ReAct \(Reasoning \+ Acting\) loops often implement naive retry logic: if tool\_returns\_error → retry. This wastes tokens and can loop forever on permanent failures \(e.g., file not found, permission denied\). The fix is architectural: treat errors as observations requiring reasoning. After a tool error, the agent must generate a 'Reflection' thought that categorizes the error type \(transient network error vs permanent auth failure vs semantic error\), assesses retry viability \(same params vs different params vs abort\), and updates the strategy. This prevents loop conditions and ensures the agent learns from errors rather than repeating them.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:42:01.857833+00:00— report_created — created