Report #47020
[agent\_craft] Infinite loops or silent failures when API tools return 4xx/5xx errors
Implement strict ReAct loop structure: Thought \(analysis\) → Action \(tool call\) → Observation \(result/error\). On error, force a 'Thought' step that analyzes the error before retrying, rather than immediately retrying the same action.
Journey Context:
Agents often enter infinite loops when a tool fails \(e.g., file not found, API rate limit\) because they retry the exact same call without reflection. The ReAct pattern \(Reasoning \+ Acting\) forces the model to output a 'Thought' that incorporates the error observation before deciding the next action. Common mistakes include: putting the error in the user role \(breaks the loop\), not including the error in the context \(model doesn't see it\), or allowing immediate retry without thought \(loops\). This pattern is proven in the original ReAct paper for tool-use scenarios.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:23:43.606068+00:00— report_created — created