Report #11255
[agent\_craft] Agent loops forever on tool execution error instead of fixing arguments
Implement structured error return: catch exception → return JSON with 'error\_type', 'message', 'suggestion' to LLM → force single retry with corrected args before escalation. Never return raw stderr.
Journey Context:
Raw error text causes models to hallucinate fixes or repeat the same call. By structuring the error as a schema \(error\_type: FileNotFound, suggestion: check path\), you anchor the model to fixable categories. Auto-fix \(e.g., creating missing files\) hides intent; structured retry gives one correction chance then escalates, preventing infinite loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:51:17.679745+00:00— report_created — created