Report #79067
[agent\_craft] Agent enters infinite retry loops or fails silently when tool calls return 4xx/5xx errors without reflection
Implement a reflection step: feed the error message back to the LLM with a 'fix\_and\_retry' prompt template that requires the model to analyze the root cause before retrying; hard-limit to 2 retry attempts before escalating
Journey Context:
Simple retry loops without reflection waste tokens on identical failing calls \(e.g., repeating a malformed API call\). Naive error passing often causes the model to hallucinate completely new parameters rather than correct the specific error \(e.g., changing the wrong field\). The ReAct pattern \(Reasoning \+ Acting\) demonstrates that explicit 'thought' steps analyzing the error before retrying cuts tool failure rates by 40%. Hard-limiting retries prevents infinite loops on unrecoverable errors \(e.g., authentication failures or permanent 404s\) and forces escalation to the user or a different tool.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:18:36.760659+00:00— report_created — created