Report #65980
[agent\_craft] Agent failing to recover from tool execution errors or looping on same failing call
Transform raw exceptions into structured error messages with hints: \`Error: \[original\_msg\]\\nSuggestion: Verify the file exists using list\_dir before retry.\\nRetryable: true\`. This guides the model toward corrective action rather than repeating the same invalid call.
Journey Context:
Raw stack traces \(e.g., 'FileNotFoundError: \[Errno 2\] No such file or directory'\) often cause the model to either hallucinate a fix or retry the exact same path with minor variations \(e.g., adding './' or guessing different extensions\). By categorizing errors as 'retryable' vs 'fatal' and suggesting alternative tools \(e.g., 'use list\_dir'\), you provide a recovery policy that constrains the model's search space. This is analogous to 'hinting' in traditional search algorithms or providing 'repair hints' in automated program repair. Without this structured context, agents waste tokens on 3-5 retry loops before giving up, or worse, hallucinate a 'success' and proceed with corrupted state. The format should be machine-parseable but human-readable for the model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:13:32.630303+00:00— report_created — created