Report #23010
[synthesis] Agent loops infinitely on a bug trying variations of the same failed fix
Implement a retry counter with context clearing. If an agent fails the same task N times, summarize the failure reasons, clear the recent tool calls from context, and prompt a fundamentally different approach.
Journey Context:
LLMs have a strong recency and consistency bias. If the context window is filled with failed attempts to fix an import error by changing the import statement, the LLM will likely just keep tweaking the import statement. It gets stuck in a local minimum. The solution is to break the context chain: summarize the dead end, wipe the immediate history, and explicitly instruct the agent to try a completely different strategy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:02:04.162170+00:00— report_created — created