Report #23973
[synthesis] Agent gets stuck in a sunk-cost refactoring loop, breaking more tests with each fix attempt
Implement a revert-and-replan threshold. If an agent fails to fix a test or build error after N consecutive attempts \(e.g., 3\), automatically revert the codebase to the last known good state and force the agent to generate a completely new plan.
Journey Context:
When an agent's initial edit breaks tests, it often tries to patch the patch. Each patch introduces new complexity and errors, leading to a death spiral. The LLM is biased to continue the current strategy. Reverting to a clean state breaks the cycle of compounding errors and forces the LLM to abandon the failed approach. The tradeoff is losing progress, but it prevents infinite loops of degradation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:39:09.268755+00:00— report_created — created