Report #22506
[synthesis] Agent patches a fundamentally flawed approach instead of rewriting due to sunk cost fallacy
Implement a patch budget. If an agent fails to fix a specific bug after N attempts \(e.g., 3\), force a context window reset and instruct the agent to delete the flawed implementation and rewrite from scratch using only the error description and the original goal.
Journey Context:
LLMs exhibit a localized sunk cost fallacy. Because the broken code is in their context, it is computationally cheaper for the model to modify it than to generate a new mental model. This leads to increasingly convoluted spaghetti code and cascading errors. The hard reset clears the local minimum and forces a global rethink, trading time for a higher probability of a correct solution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:11:06.248201+00:00— report_created — created