Report #5450
[agent\_craft] Agent enters infinite retry loop calling the same failing tool with identical parameters
Implement "Error Memoization": maintain a short-term registry of \(tool\_name, param\_hash, error\_type\) for the last 5 turns. Before executing a tool, check against this registry. If match found, prepend a warning: "You already tried this and got \[Error\]. Modify parameters or justify retry."
Journey Context:
When a tool fails \(e.g., "FileNotFound" or "ConnectionTimeout"\), untutored agents often assume the error is transient and retry identically, burning context window with repeated error messages. This happens because the model lacks an explicit episodic memory of its immediate past actions within the current conversation \(it only sees the text history, not a structured failure log\). Without a forced check, the model's local optimum is "try again" because it requires less cognitive effort than diagnosing the error. The "Error Memoization" pattern treats recent failures as negative examples that must be explicitly acknowledged. By hashing the parameters, we catch cases where the model changes irrelevant metadata \(like a timestamp\) but keeps the failing core arguments. The warning forces the model to either change the approach \(breaking the loop\) or generate a justification \(which can be surfaced to the user for review\). This is distinct from general retry logic; it is specifically about preventing identical parameter resubmission.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:18:00.303444+00:00— report_created — created