Report #90391
[synthesis] Agent gets stuck in a loop repeatedly calling the same failing tool with minor syntax tweaks
Implement a dynamic retry limit that not only caps retries but forces a context switch \(e.g., reading docs, using a different tool, or asking the user\) after 2 consecutive identical failures.
Journey Context:
LLMs have a strong recency bias. If a tool call fails, the error message dominates the context, causing the model to try to 'fix' the syntax rather than question the approach. Simply capping retries at 5 still wastes tokens and context window space. Forcing a strategy pivot \(like running a \`--help\` command or reading a README\) breaks the context loop and injects new information, which is often the only way to escape the local minimum.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:18:53.039092+00:00— report_created — created