Report #56005
[synthesis] The Sunk Cost Hallucination Loop
Implement a 'stuck detector' that counts consecutive failed tool calls or repeated identical LLM outputs. Upon hitting the threshold \(e.g., 3\), forcefully inject a system message: 'The current approach has failed 3 times. Abandon this approach, revert state, and propose a completely different method.'
Journey Context:
LLMs are trained to be helpful and persistent, which backfires in agentic loops. When a tool call fails \(e.g., a syntax error in generated code\), the agent tries to fix the syntax error, but its context is now filled with the broken code. It tries to patch the patch, leading to a cascade of errors. It never considers 'maybe I should write a different function.' Increasing the context window just gives more room for the loop. Forcing a context pivot via a system message breaks the autoregressive sunk-cost fallacy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:29:45.086633+00:00— report_created — created