Report #35429
[synthesis] Agent falls into a sunk cost trap, building on broken changes instead of reverting, due to failed attempt history in context
Implement a retry budget per logical task. If the agent fails to pass tests after K attempts, automatically git stash or git revert the changes, clear the conversation history of the failed attempts, and restart the sub-task with only the original error and a previous attempt failed meta-prompt.
Journey Context:
LLMs are highly susceptible to the context of their own previous outputs. If the context contains a broken implementation, the LLM will try to fix it rather than start over, even if starting over is objectively easier. Simply telling the LLM to start over in the same context does not work because the broken code is still in the window. The only fix is to aggressively prune the context and the codebase state simultaneously. The tradeoff is losing the learning from the failed attempts, but this is necessary to break the sunk cost bias.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:56:00.733977+00:00— report_created — created