openclaw - 💡(How to fix) Fix Heartbeat + auth fallback + message tool creates cascading delivery-mirror feedback loop [1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#74034Fetched 2026-04-30 06:29:35
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
mentioned ×2subscribed ×2closed ×1commented ×1

When an agent's heartbeat fires while the primary model provider has invalidated auth tokens (all profiles in cooldown), the fallback chain eventually reaches an alternative provider. That provider's LLM sees session context about "empty messages" and uses the message tool to send replies directly to the user's messaging channel. This creates a self-reinforcing feedback loop where each heartbeat cycle generates another user-facing message, which then becomes context for the next heartbeat, ad infinitum.

Error Message

23:34:14 — lane task error: lane=session:agent:harry-vip:main error="FailoverError: No available auth profile for openai-codex (all in cooldown or unavailable)."

23:34:49 — message tool result: channel=whatsapp, to=+554799810540 messageId=3EB058C2A090A42C5BEEE7

Root Cause

When an agent's heartbeat fires while the primary model provider has invalidated auth tokens (all profiles in cooldown), the fallback chain eventually reaches an alternative provider. That provider's LLM sees session context about "empty messages" and uses the message tool to send replies directly to the user's messaging channel. This creates a self-reinforcing feedback loop where each heartbeat cycle generates another user-facing message, which then becomes context for the next heartbeat, ad infinitum.

Code Example

heartbeat fires (every 30m)
  → prompt injected into agent main session
  → primary model fails (auth error)
  → all auth profiles enter cooldown
  → fallback chain exhausted: gpt-5.5 → gpt-5.4-mini → gpt-5.4-nano → all fail
  → falls back to alternative provider (e.g., oc/kimi-k2.6)
  → alternative LLM sees session context about "empty messages"
LLM uses `message` tool to send "I'm receiving empty messages..." to user's WhatsApp
  → user receives unexpected message
  → next heartbeat: context now includes the auto-generated message
  → alternative LLM sends ANOTHER message ("I'll stop responding now")
  → loop continues indefinitely

---

23:34:14 — lane task error: lane=session:agent:harry-vip:main
           error="FailoverError: No available auth profile for openai-codex
           (all in cooldown or unavailable)."

23:34:49 — message tool result:
           channel=whatsapp, to=+554799810540
           messageId=3EB058C2A090A42C5BEEE7
RAW_BUFFERClick to expand / collapse

Summary

When an agent's heartbeat fires while the primary model provider has invalidated auth tokens (all profiles in cooldown), the fallback chain eventually reaches an alternative provider. That provider's LLM sees session context about "empty messages" and uses the message tool to send replies directly to the user's messaging channel. This creates a self-reinforcing feedback loop where each heartbeat cycle generates another user-facing message, which then becomes context for the next heartbeat, ad infinitum.

Steps to Reproduce

  1. Configure an agent with:

    • heartbeat.every: "30m"
    • heartbeat.model: "openai-codex/gpt-5.5" (or any provider that can enter auth cooldown)
    • tools.profile: "full" (which includes the message tool)
    • WhatsApp channel connected
  2. Cause the primary model's auth tokens to become invalidated (e.g., token expiry, provider outage)

  3. Wait for heartbeat cycles to fire

What Happens

heartbeat fires (every 30m)
  → prompt injected into agent main session
  → primary model fails (auth error)
  → all auth profiles enter cooldown
  → fallback chain exhausted: gpt-5.5 → gpt-5.4-mini → gpt-5.4-nano → all fail
  → falls back to alternative provider (e.g., oc/kimi-k2.6)
  → alternative LLM sees session context about "empty messages"
  → LLM uses `message` tool to send "I'm receiving empty messages..." to user's WhatsApp
  → user receives unexpected message
  → next heartbeat: context now includes the auto-generated message
  → alternative LLM sends ANOTHER message ("I'll stop responding now")
  → loop continues indefinitely

Evidence

Real-world cascade observed over ~7 hours on 2026-04-28, all via delivery-mirror entries correlating with web-outbound WhatsApp deliveries:

Time (UTC)Message sent to user
00:19"parou de chegar conteúdo real. Tô aqui, mas preciso de texto pra agir."
00:35"O áudio não está funcionando. Removi o script quebrado..."
00:51"Zote, recebo suas mensagens mas estão vazias."
01:04"Zote, paro de responder a isso agora. Tô aqui, só manda texto real..."
02:04"Zote, parei de gastar tokens respondendo à vazio."
02:34"❌ Áudio não funciona. Zero arquivos chegando. Manda texto 👍"

Log evidence for the 02:34 cascade:

23:34:14 — lane task error: lane=session:agent:harry-vip:main
           error="FailoverError: No available auth profile for openai-codex
           (all in cooldown or unavailable)."

23:34:49 — message tool result:
           channel=whatsapp, to=+554799810540
           messageId=3EB058C2A090A42C5BEEE7

Session transcript shows empty user messages ("text": "") being injected into the main session at each heartbeat trigger, which the fallback LLM interprets as "the user is sending empty audio."

Proposed Fixes

  1. Heartbeat isolation: Heartbeat-triggered runs should not have access to the message tool (or any outbound delivery tool) unless explicitly configured. The heartbeat's output should be introspection-only by default.

  2. Empty-message loop detection: The delivery-mirror or auto-reply system should detect when it's generating repeated "empty message" fallback texts and apply a cutoff after N consecutive such deliveries.

  3. Auth-agnostic heartbeat: Consider allowing heartbeats to use a different (more reliable) model than the main conversation model, so auth failures on the primary provider don't block heartbeat processing.

Environment

  • OpenClaw version: 2026.4.25-da6bdffc3d96
  • Node: 25.9.0
  • Platform: Darwin arm64 (macOS)

extent analysis

TL;DR

Implement heartbeat isolation to prevent the message tool from sending replies during heartbeat cycles when the primary model provider has invalidated auth tokens.

Guidance

  • Review the proposed fixes and consider implementing heartbeat isolation to restrict the message tool's access during heartbeat-triggered runs.
  • Investigate the empty-message loop detection approach to prevent repeated "empty message" fallback texts.
  • Evaluate the feasibility of using a different model for heartbeats to mitigate auth failures on the primary provider.

Example

No code snippet is provided as the issue does not require a specific code change, but rather a configuration or design adjustment.

Notes

The provided information suggests that the issue is specific to the OpenClaw version 2026.4.25-da6bdffc3d96 and may not be applicable to other versions or environments.

Recommendation

Apply workaround: Implement heartbeat isolation to prevent the message tool from sending replies during heartbeat cycles when the primary model provider has invalidated auth tokens, as this approach directly addresses the identified issue and prevents the self-reinforcing feedback loop.

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…

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 Heartbeat + auth fallback + message tool creates cascading delivery-mirror feedback loop [1 comments, 2 participants]