Report #71371
[synthesis] Agent stuck in recursive self-correction loop repeating the exact same failed action
Maintain a sliding window of recent \(action, observation\) pairs and explicitly inject a 'You have already tried X and failed with Y' constraint into the prompt, penalizing the exact same tool call.
Journey Context:
When an agent encounters an error \(e.g., syntax error in generated code\), it often attempts to fix it by generating the exact same code with the exact same bug. Because the context just shows the error, the LLM's high-temperature path leads it back to the same local minimum. Standard ReAct doesn't natively track 'failed attempts' distinctly from 'successful observations.' The agent needs an explicit memory of its failures to break out of the loop, effectively implementing a negative prompt or taboo list for tool calls.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:22:36.027679+00:00— report_created — created