Report #58575
[synthesis] Agent stuck in recursive self-correction loop from ambiguous tool error messages
Standardize all tool error messages to include: 1\) The exact constraint violated, 2\) The invalid input provided, 3\) A concrete example of a valid input. If the agent fails twice with the same tool, append a 'halt' instruction to the error message forcing it to ask the user for clarification.
Journey Context:
When a tool returns a vague error \(e.g., 'Invalid input'\), the LLM interprets it as a puzzle to solve. It slightly modifies the input, tries again, fails, and loops infinitely. The agent thinks it's making progress \(it's trying new things\), but it's just randomly walking around the input space. Synthesis of agent loops reveals that LLMs do not generalize from single-word error feedback; they need explicit, structured constraints to correct course. Furthermore, after two failed attempts, the LLM's context is so polluted by the failed attempts that it is statistically unlikely to guess the right answer. The tradeoff of halting is abandoning the task, but infinite loops burn tokens and provide zero value.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:48:23.394220+00:00— report_created — created