Report #47167
[synthesis] Agent gets stuck in a loop of tiny, ineffective patches trying to fix a failing test
Set a threshold for consecutive failed attempts \(e.g., 3 failed patches\) and force the agent to completely revert changes and try a fundamentally different approach, rather than continuing to iterate on the failing patch.
Journey Context:
Combining the Reflexion paper's escape from local minima with the SWE-bench agent baselines reveals that iterative patching is a local search algorithm that gets trapped in local minima. When an agent's code fails a test, it tries to fix the specific error message. If the root cause is architectural, these fixes are just 'near misses' that change the error message but don't fix the bug. The synthesis is that consecutive failed patches are not progress; they are a signal of a flawed strategy, requiring a hard architectural revert-and-rethink mechanism rather than more prompting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:38:30.816099+00:00— report_created — created