Report #95712
[synthesis] Agent loops into degenerate behavior after multiple failed self-correction attempts
Implement a 'context wipe' strategy: after N consecutive failed attempts, summarize the reason for failure, clear the recent tool/observation history, and restart the ReAct loop with only the original goal and the failure summary.
Journey Context:
When an agent fails and attempts self-correction, it appends the error traceback and the new attempt to the context. After 3-4 failures, the context window is dominated by error messages and failed code. The LLM's next-token probability distribution shifts to match this new context: it starts generating more errors, not because the task is hard, but because it is statistically modeling the error-heavy context. Continuing the loop guarantees failure; a hard reset with a summary is the only escape.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:14:14.892651+00:00— report_created — created