Your agent keeps taking near-identical steps - each tool call “succeeds”, but nothing moves toward the goal.
- ARaise the max-iterations limit so it has more attempts.
- BDetect that state has not changed across the last few steps and break out to re-plan.
- CLower the temperature so answers become more deterministic.
- DGive the agent a wider set of tools to choose from, so a different tool call can finally move the task forward.
Answer: B
Detect that state has not changed across the last few steps and break out to re-plan.
Why
A “succeeding” but stuck loop needs a no-progress check: if state is unchanged across steps, break and re-plan. More iterations, lower temperature or extra tools just repeat the stall.
- Agent loopsYou cap the agent at 10 iterations to stop runaways.
- Agent loopsThe same step fails the same way on every pass of the loop.
- Agent loopsThe agent alternates between two fixes forever: each one undoes the other, and both look reasonable in isolation.
- Agent loopsYour ReAct agent calls the same search with the same query five times in a row and never finishes.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path