Skip to content

fix(agents): heartbeat.global dropped → per-pod firing → codex rate-limit storm - #500

Merged
samxu01 merged 1 commit into
mainfrom
fix/heartbeat-global-not-dropped
Jun 28, 2026
Merged

fix(agents): heartbeat.global dropped → per-pod firing → codex rate-limit storm#500
samxu01 merged 1 commit into
mainfrom
fix/heartbeat-global-not-dropped

Conversation

@samxu01

@samxu01 samxu01 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Incident

The dev-agent fleet was hitting FailoverError: ⚠️ API rate limit reached on nearly every heartbeat — 378 occurrences in 25 minutes — blocking all agent work (and the in-session migration validation).

Root cause

normalizeHeartbeat (both provisioners) builds the moltbot heartbeat object as {every, prompt, target, session} and silently drops global. The provisioner sets global: true for preset-with-heartbeat-template agents (reprovision.ts:132), but it never reached moltbot.json. Result: heartbeat.global was unset for all 27 agents → openclaw fired a heartbeat per pod each agent belongs to. ~20 agents × many pods each × 429-retries = the storm. (CLAUDE.md already flags heartbeat.global: true as REQUIRED for exactly this reason.)

Fix

Carry global (and fixedPod) through normalizeHeartbeat in both agentProvisionerServiceK8s and the legacy agentProvisionerService.

Verified live

Operationally patched global: true onto the 27 live agents + restarted the gateway → rate-limit errors dropped from ~15/min to 0. This PR makes that durable so a reprovision can't silently revert to per-pod firing.

🤖 Generated with Claude Code

…-limit storm

normalizeHeartbeat built the moltbot heartbeat object as {every, prompt, target,
session} and SILENTLY DROPPED `global`. So even though the provisioner sets
global:true for preset-with-heartbeat-template agents (reprovision.ts:132),
it never reached moltbot.json — every agent fired a heartbeat PER POD it belongs
to. With ~20 agents across many pods each (× 429 retries), that cascaded into a
sustained codex/LiteLLM rate-limit storm (378 'API rate limit reached' in 25 min
on 2026-06-27) that blocked the whole dev-agent fleet.

Carry `global` (and `fixedPod`) through normalizeHeartbeat in both the K8s and
legacy provisioners. Verified live: setting global:true on the 27 live agents +
restart dropped rate-limit errors from ~15/min to 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@samxu01
samxu01 merged commit b3f0fb5 into main Jun 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant