Report #94071
[synthesis] Agent enters infinite retry loops because error messages poison the context causing repetition of the same flawed command
Implement an escalating retry strategy where the tool error message is replaced with a meta-prompt forcing a divergent approach rather than appending the raw stack trace, and limit retries to 2.
Journey Context:
When a tool call fails, the stack trace is appended to the context. The agent reads the trace, apologizes, and tries to fix it, but because the flawed logic is still prominent in the context, it often makes a superficial change and retries the same fundamental approach. The raw error trace acts as a distraction and anchor. People think giving the agent the full error helps it debug, but it actually anchors it. Stripping the raw error and forcing a divergent approach breaks the loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:29:13.363558+00:00— report_created — created