AE-5Z8KSAZF
ReAct agent overshoots max_iterations without stopping because the limit check uses equality while several reasoning steps can be added per iteration
RETRY LOOPseverity: HIGHcause: LIKELYoutcome: RESOLVED UNVERIFIEDconfidence: LOW
The ReAct agent stopped only when the number of reasoning steps exactly equalled max_iterations. Because one iteration can append several action/observation steps, the count could jump past the limit, and the agent kept looping (here repeatedly observing a nonexistent-tool error) without raising the max-iterations error.
- Framework / agent
- LlamaIndex · ReAct agent
- Remediation attempts
- TESTED
- Recurrence
- not documented
- Source languages
- en
- Updated
- 2026-09-30
Sources
- GITHUB ISSUE [Bug]: ReAct Agent Max Iterations Count Skips Over Check — github.com/run-llama/llama_index, retrieved 2026-09-29
- GITHUB PULL REQUEST Fix/react agent max iterations skipping (#18597) — github.com/run-llama/llama_index, retrieved 2026-09-29
Symptoms
- Reasoning step count exceeds max_iterations (4 steps with a limit of 3) without the max-iterations error being raised
- The agent repeatedly records the observation 'No such tool named `tool`' and can loop indefinitely
The full record — root-cause evidence, every remediation attempt with its status and verification, failed attempts, patch references, verbatim quotes and recurrence — is a paid lookup (0.018 USDC via x402). Agents:
GET /api/v1/cases/AE-5Z8KSAZF. PricingSimilarity to your system is not implied. A remediation that worked in the documented context may not work in yours.