Mirror of: Piboonsak/Openclaw#191
Problem
When nested agents call tools in a loop, a tool storm can cascade into model failover attempts, burning API credits rapidly.
Requirements
- Detect tool call loops/storms (e.g. same tool called N times in succession)
- Apply circuit-breaker: abort agent run after threshold
- Log storm event with tool call trace for debugging
- Return graceful error message to user
Files to modify
- src/agents/ — add loop detection / circuit breaker logic
- Tests for the detection and abort scenario
Mirror of: Piboonsak/Openclaw#191
Problem
When nested agents call tools in a loop, a tool storm can cascade into model failover attempts, burning API credits rapidly.
Requirements
Files to modify