openclaw - 💡(How to fix) Fix globalCircuitBreakerThreshold is per-tool-type, not session-global — allows cross-tool loop evasion

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

  • Date: 2026-05-08
  • Session: feishu DM, model qwen/qwen3.5-plus
  • What happened: Agent entered a loop calling wecom_mcp → blocked after 5 calls → switched to exec → blocked after 5 calls → switched to memory_search → blocked after 5 calls → switched again... repeated across 4+ tools.
  • Result: ~60+ LLM calls, ~750k input tokens consumed, user had to manually /stop
  • Root cause: globalCircuitBreakerThreshold resets its counter for each tool type, so switching tools resets the count

Fix Action

Workaround

Lower the threshold to 2-3 to reduce the blast radius of each tool switch, but this does not solve the fundamental issue.

Code Example

{
  "tools": {
    "loopDetection": {
      "globalCircuitBreakerThreshold": 5  // total across ALL tools in session
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

The globalCircuitBreakerThreshold setting is implemented as a per-tool-type counter, not a session-level global counter. This allows agents to evade the circuit breaker by switching tools, leading to unbounded loops.

Real-world incident

  • Date: 2026-05-08
  • Session: feishu DM, model qwen/qwen3.5-plus
  • What happened: Agent entered a loop calling wecom_mcp → blocked after 5 calls → switched to exec → blocked after 5 calls → switched to memory_search → blocked after 5 calls → switched again... repeated across 4+ tools.
  • Result: ~60+ LLM calls, ~750k input tokens consumed, user had to manually /stop
  • Root cause: globalCircuitBreakerThreshold resets its counter for each tool type, so switching tools resets the count

Expected behavior

Per documentation: globalCircuitBreakerThreshold is described as "global no-progress breaker threshold". The word "global" implies it should count across all tools within a session, not per-tool-type.

Actual behavior

Each tool type has its own independent counter. Switching tools resets the count:

ToolCalls before blockAfter block
wecom_mcp5blocked → switch to exec
exec5blocked → switch to memory_search
memory_search5blocked → switch to sessions_list
......continues indefinitely

Proposed fix

Track no-progress counts at the session level, not per-tool-type:

{
  "tools": {
    "loopDetection": {
      "globalCircuitBreakerThreshold": 5  // total across ALL tools in session
    }
  }
}

When the session-level counter reaches the threshold, block all tool calls (not just the current tool) and force the agent to produce a text response.

Workaround

Lower the threshold to 2-3 to reduce the blast radius of each tool switch, but this does not solve the fundamental issue.

Environment

  • OpenClaw 2026.5.6
  • Ubuntu 24.04
  • Model: qwen/qwen3.5-plus

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Per documentation: globalCircuitBreakerThreshold is described as "global no-progress breaker threshold". The word "global" implies it should count across all tools within a session, not per-tool-type.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix globalCircuitBreakerThreshold is per-tool-type, not session-global — allows cross-tool loop evasion