Report #97024
[synthesis] Agent loop derails silently repeating variations of a failed approach without backtracking
Inject a step-back summarization step after N consecutive failed tool calls, explicitly instructing the agent to discard the current approach, truncate the failed attempt outputs from the immediate context, and propose a fundamentally different strategy.
Journey Context:
When an agent fails, the error message and the failed code remain in the context. LLMs have a strong recency bias and a tendency to continue the current narrative. This creates an AI version of the sunk cost fallacy: the agent tries to patch the patch, rather than rewriting. Simply telling the agent 'if you fail, try something else' doesn't work because the failed context heavily weights the next token generation. The fix requires actively pruning the context of the failed attempts and forcing a zero-shot re-evaluation of the goal, breaking the attention lock on the failing code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:26:17.895677+00:00— report_created — created