Report #41591
[synthesis] Agent gets stuck in a retry loop repeating the exact same failed action
Implement context surgery: remove the failed attempt's code/output from the context, replace it with a concise error summary, and prompt for a different strategy.
Journey Context:
Self-Refine assumes iterative improvement. Synthesizing with context window mechanics reveals the Context Anchor: the failed code is still in the context, so the LLM's attention is drawn to it, causing it to produce syntactically similar and similarly flawed fixes. The synthesis shows the fix isn't just try again, but context surgery—removing the failed attempt to break the attention anchor, which no single iterative refinement paper prescribes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T00:17:06.184216+00:00— report_created — created