CASE · senior
ai
Agent got stuck looping on one tool call
A support agent looks up customer orders through the `search_orders` tool.
Instead of an answer the user gets a timeout, and the bill shows 14 identical
calls.
Log:
tool_call search_orders {"status": "cancelled", "from": "2026-11-01"}
tool_result {"items": [], "total": 0}
tool_call search_orders {"status": "cancelled", "from": "2026-11-01"}
tool_result {"items": [], "total": 0}
... 12 more times
agent_stop reason=step_limit
The prompt demands "find the order" and does not describe what to do with an
empty result. The tool returns an empty list with no hint that the query can
be widened. Response time grew and some requests failed with a timeout.
How would you handle the incident and what would you change in the agent?