Report #93504
[agent\_craft] Infinite loops or silent failures when tool calls return errors \(file not found, syntax error, API failure\)
Implement the ReAct error-recovery loop: Observe error → Reason about cause → Select recovery action \(retry with correction / ask user / use fallback\). Hardcode a maximum of 3 retry attempts with exponential backoff before escalating to the user.
Journey Context:
Without explicit error handling, agents either hallucinate success \('The file has been edited' when it failed\) or enter infinite retry loops \('file not found' → retry same path → repeat\). The ReAct pattern structures this as: Thought \(analyze error\), Action \(choose recovery\). Common mistakes: returning raw stack traces to the LLM without structure \(confuses the model\), or allowing unlimited retries \(burns tokens and time\). Alternative is Reflexion \(self-critique\), but that's expensive. The robust, token-efficient fix is a fixed retry counter with structured error objects \(type, message, suggestion\) passed to the LLM for the recovery decision.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:32:04.818981+00:00— report_created — created