Report #79985
[agent\_craft] Agent enters infinite retry loops on tool errors
Implement a strict Thought-Action-Observation cycle: require the model to output a 'Thought' analyzing the error and proposing a new strategy before any retry, and halt after 2 consecutive failures.
Journey Context:
Without forced reasoning, agents exhibit 'brute-force' behavior: when a tool returns an error \(e.g., 'file not found'\), the model slightly mutates the arguments \(e.g., adds/removes './'\) and retries indefinitely. This wastes tokens and fails to address the root cause \(e.g., the file is in /tmp, not .\). The ReAct pattern breaks this by interleaving explicit reasoning: the model must state 'The file was not found in the current directory; I should check /tmp using the list tool' before acting. This cognitive pause prevents reflexive looping and enables strategy shifts \(e.g., from 'edit' to 'diagnose'\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:51:41.182727+00:00— report_created — created