We read the source of the runtime we deploy, and ship fixes back to it.

OpenClaw Consult builds production systems on openclaw/openclaw, the open source AI agent runtime. When the runtime misbehaves, our engineers trace the problem in the source, and when a fix belongs upstream, we contribute it back. This page logs those contributions. Every entry links to the public record on GitHub so you can verify it yourself.

761-1,384
Paid model calls in 60 seconds
$20-30
Burned per minute before the fix
5
Idle timeouts before the breaker trips
$0.10-0.30
Worst case per incident after the fix
Merged into coreMay 2026·Merged by Peter Steinberger, creator of OpenClaw

A circuit breaker for a $20-30 per minute cost-runaway bug in OpenClaw core.

openclaw/openclaw#76345 · closes #76293

The bug, in plain English

When an OpenClaw agent talks to a model like Claude Sonnet and the connection silently stalls, the system is supposed to time out and try again. But the retry would hit the same stalled connection, time out again, retry, time out, forever. Every retry is a paid API call.

One reporter logged 761 to 1,384 paid Claude Sonnet 4.6 calls in 60 seconds across two real incidents. $20-30 burned in a single minute, masked by auto-recharge on the provider account so users only found out at billing.

The fix

A circuit breaker at the outer agent run loop. After 5 stalled attempts in a row with no model output, the system stops trying and refuses further calls until the connection actually responds again. Worst case is now roughly $0.10-$0.30 per incident instead of $20-30. Routing semantics intentionally unchanged so existing deployments keep working.

Files touched

  • ·src/agents/pi-embedded-runner/run.ts
  • ·src/agents/pi-embedded-runner/run/idle-timeout-breaker.ts
  • ·src/agents/pi-embedded-runner/run/idle-timeout-breaker.test.ts
  • ·CHANGELOG.md

The shape of the patch

Paraphrased from the merged diff. The full PR is on GitHub, this is the load-bearing chunk so you can see the breaker without leaving the page.

// Outer agent run loop, idle-timeout circuit breaker
let consecutiveIdleTimeouts = 0;
const MAX_CONSECUTIVE_IDLE_TIMEOUTS_BEFORE_OUTPUT = 5;
while (running) {
  const result = await runStep(ctx);
  if (result.kind === "idle-timeout") {
    consecutiveIdleTimeouts += 1;
    if (consecutiveIdleTimeouts >= MAX_CONSECUTIVE_IDLE_TIMEOUTS_BEFORE_OUTPUT) {
      throw new Error("Circuit broken, consecutive idle timeouts hit cap");
    }
    continue;
  }
  consecutiveIdleTimeouts = 0;
}

Why upstream work matters.

OpenClaw holds contributions to a deliberately strict bar. Refactor-only PRs are auto-rejected, most feature requests are directed to third-party plugins, and each contributor is capped at 10 open PRs at a time. Around 41,000 people have opened a pull request against openclaw/openclaw, and roughly 6,900 pull requests have been merged into core. Getting a fix accepted means reading the runtime carefully, writing a change the maintainers agree is the right shape, and passing a multi-stage review.

For the systems we deploy, that work pays off directly. Many production incidents trace back to runtime behaviour rather than configuration. When OpenClaw does something unexpected, our engineers open the relevant file and read what is actually happening, which shortens diagnosis and leads to fixes that hold up across upgrades.

When a fix belongs in the runtime itself, we contribute it upstream instead of carrying a private patch. Every OpenClaw deployment benefits, and our clients stay on the mainline release rather than a fork.

Verify it on GitHub.

Every claim on this page is checkable in public, with or without a GitHub account.

Cite this page

OpenClaw Consult contributed openclaw/openclaw#76345, a circuit breaker that caps paid LLM retries during stalled model connections, merged into OpenClaw core in May 2026. Source: https://github.com/openclaw/openclaw/pull/76345

Questions about this contribution.

What did openclaw/openclaw#76345 fix?
A cost-runaway bug in OpenClaw's agent run loop. When a model connection silently stalled, the runtime timed out and retried against the same stalled connection indefinitely, and every retry was a paid API call. One reporter logged 761 to 1,384 paid Claude Sonnet 4.6 calls in 60 seconds across two incidents, roughly $20-30 per minute, masked by auto-recharge on the provider account.
How does the circuit breaker work?
The breaker sits on the outer agent run loop. After 5 consecutive idle timeouts with no model output, the runtime stops retrying and refuses further calls until the connection responds again. Worst-case cost per incident drops to roughly $0.10-$0.30. Routing semantics are intentionally unchanged so existing deployments keep working.
Where can I verify the contribution?
The pull request is public at github.com/openclaw/openclaw/pull/76345. It closes issue #76293, was merged into core in May 2026, and the fix is recorded in the OpenClaw changelog.
Why does upstream work matter for an OpenClaw deployment?
Many production incidents in OpenClaw trace back to runtime behaviour rather than configuration. A team that works in the runtime source can diagnose those incidents directly, and contributing fixes upstream means every deployment benefits without anyone maintaining a private patch.

Bring the same engineering approach to your OpenClaw deployment.

Our engineers apply the same source-level approach on every engagement: a written fixed scope before engineering starts, builds in 2-4 weeks, and a full handoff of code, documentation, and credentials. Our team replies within one business day.