Report #15388
[agent\_craft] Agent enters infinite loop or hallucinates success when a tool returns HTTP 5xx or empty result
Explicitly define an 'Observation: Error' state in the agent loop schema \(ReAct\), and require the model to emit a specific 'ANALYZE\_ERROR' action before retrying, forcing it to process the error string rather than ignore it.
Journey Context:
Standard prompts assume tools always return valid data. When errors occur, models either repeat the failed action \(infinite loop\) or hallucinate success \(false positive\). The ReAct paper formalized the loop as Thought -> Action -> Observation. Crucially, Observation includes error states. By requiring the model to acknowledge the error observation with a distinct analysis step, we break the loop. This differs from simple 'try-catch' logic because the LLM must semantically interpret the error \(e.g., 'Rate limit hit, wait 60s' vs '404, skip'\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:54:01.394428+00:00— report_created — created