-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Tool call circuit breaker needed — LLMs will blindly retry forever without one #78865
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
I just spent 50 minutes watching my agent bash its head against a wall, and I'm here to tell you this is a critical missing feature.
What happened
My agent hit a
rate limitederror from an external API. What did it do? Did it stop and ask me? Of course not. It did this:Seven times. The same failing operation. Seven. Times.
And here's the best part — every single retry made the rate limit worse. The agent was actively sabotaging itself, and the platform just let it happen.
The core problem
LLMs are fundamentally incapable of knowing when to stop. Their training says "be helpful, try to solve the problem." They do not have a built-in "this isn't working, ask the human" reflex. They will:
This is not a prompt engineering problem. I already have
AGENTS.mdrules saying "don't retry." The model ignored them because in the moment, it genuinely believes the next retry might work. It always believes that. It will always believe that.What OpenClaw should do
The platform cannot rely on the model to self-regulate. It needs hard circuit breakers:
Repeated tool call detection: If the same tool is called with similar arguments N times (e.g., 3) within a short window and all calls fail, block the next call and present the user with the error summary + a "retry?" confirmation.
Rate limit awareness: When a tool returns 429 / "rate limited" / similar, the platform should freeze that tool for a cooldown period (e.g., 2-5 minutes) and inform the user. Don't let the model touch it again until the cooldown expires or the user explicitly overrides.
Error category classification: Not all errors are equal. The platform should distinguish between:
Escalation counter: Track consecutive failures across the session. After N failures (configurable), force a pause and ask the user what to do.
Why this can't be left to AGENTS.md
AGENTS.md is a suggestion. The model reads it at session start and then... mostly forgets it when it's in the middle of a loop. It's like putting a "don't eat the cookies" sign next to a cookie jar and expecting it to work on a toddler. The enforcement has to happen at the platform level, not the prompt level.
TL;DR
LLMs will retry forever. They can't help it. OpenClaw needs to be the adult in the room and pull the plug when the model is clearly stuck in a loop. Tool call circuit breakers aren't a nice-to-have — they're essential for any platform that lets agents run autonomously.
Please add circuit breaker / retry guard functionality. The current "let the model figure it out" approach is broken by design.