Report #48210
[agent\_craft] Agent enters infinite loop re-running failed grep or file read commands
Require a structured \`\` block analyzing the tool failure \(e.g., 'file not found because path was absolute vs relative'\) and a \`\` block describing the parameter change BEFORE issuing the next tool call. Fail after 3 mutations without success.
Journey Context:
Raw ReAct loops fail because the model treats tool errors \(empty grep results, permission denied\) as transient network blips rather than logic errors, retrying identical parameters. Mandating a structured reflection step \(as formalized in Reflexion architectures\) breaks the loop by forcing the model to update its internal world model and explicitly state what changed \(e.g., broadening regex from \`^foo\` to \`foo\`, or changing directory from \`./src\` to \`.\`\). Without this structural constraint, agents will execute \`grep -r "bar" ./src\` five times in a row despite the match being in \`./lib\`, burning tokens and latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:24:02.412134+00:00— report_created — created