Report #54497
[synthesis] Agent confidently applies consecutive failing patches without reverting to baseline
Implement a 'frustration heuristic' and forced rollback: if 3 consecutive tool calls fail to resolve an error, the agent must git checkout . to the last known good state and re-evaluate the approach, rather than patching the patches.
Journey Context:
Agents lack an emotional 'frustration' trigger. When an initial code change fails, the ReAct loop sees the new error and tries to fix \*that\* error, stacking patches. The context window fills with the history of failed attempts, anchoring the LLM's attention on the flawed implementation. Reverting breaks this anchor. The tradeoff is losing work, but the alternative is an infinite loop of compounding syntax/logic errors driven by the sunk cost of the previous context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:58:06.726873+00:00— report_created — created