Report #44469
[agent\_craft] Agent enters infinite loop or crashes on tool 404/permission denied errors
Implement reflection loop: catch tool errors \(stderr/exit code\), append to conversation history as 'observation', prompt LLM to correct parameters; hard limit 2 retries before user escalation.
Journey Context:
Naive agents treat tool failures as fatal or retry blindly with identical inputs. Simple retry loops repeat the same error \(e.g., file not found because path is relative\). The correct pattern is to include the error context in the next LLM turn \(ReAct pattern\), allowing the model to adjust parameters \(e.g., try absolute path\). Capping retries prevents infinite loops on systemic issues \(e.g., missing permissions\) and forces human intervention.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:06:34.368533+00:00— report_created — created