openclaw - 💡(How to fix) Fix [Bug]: WhatsApp channel force-reconnects every 30 minutes on quiet-device sessions [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#70678Fetched 2026-04-24 05:54:49
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

On a WhatsApp account linked to OpenClaw as a secondary device, the gateway force-reconnects the WhatsApp socket every 30 minutes even though the socket is healthy. I noticed it since [email protected] but may have existed prior.

Root Cause

On a WhatsApp account linked to OpenClaw as a secondary device, the gateway force-reconnects the WhatsApp socket every 30 minutes even though the socket is healthy. I noticed it since [email protected] but may have existed prior.

Fix Action

Fix / Workaround

Raising DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS locally to 24h silences the reconnects for me, which is what I've been doing since [email protected] via a small patch.

Code Example

const DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS = 30 * 6e4;
RAW_BUFFERClick to expand / collapse

Bug type

Existing bug

Beta release blocker

No

Summary

On a WhatsApp account linked to OpenClaw as a secondary device, the gateway force-reconnects the WhatsApp socket every 30 minutes even though the socket is healthy. I noticed it since [email protected] but may have existed prior.

Steps to reproduce

  1. Link WhatsApp to OpenClaw as a secondary device via WhatsApp standard QR flow (primary phone remains the main WhatsApp client)
  2. Leave the socket with no inbound traffic for 30+ minutes
  3. Watch the gateway event log

Expected behaviour

Quiet socket stays up.

Actual behaviour

After ~30 minutes of inbound silence, the gateway marks the WhatsApp channel stale and force-reconnects. Cycle repeats every 30 minutes. The log fills with disconnected (499) -> reconnect pairs.

OpenClaw version

2026.4.22

Logs, screenshots, and evidence

Narrowing it down ended at this line in dist/server.impl-*.js (line 6529 on 4.22 for me):

const DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS = 30 * 6e4;

The health monitor uses inbound-event freshness as its metric. On a quiet device the socket is actually fine, but the threshold still trips and schedules a restart.

The Telegram status adapter opts out of this check via skipStaleSocketHealthCheck: true. The WhatsApp status adapter doesn't set it, so the default 30-minute window applies.

Raising DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS locally to 24h silences the reconnects for me, which is what I've been doing since [email protected] via a small patch.

Impact and severity

Affected: Secondary WhatsApp setups where the primary phone handles inbound traffic. Doesn't look like it'd hit single-device setups. Severity: Minor - reconnect churn, no message loss. Frequency: Every 30 minutes on a quiet socket. Consequence: 48 reconnects per day in the gateway log; I mistook it for instability initially.

Additional information

PR #69833 in 2026.4.22 added skipStaleSocketHealthCheck: true for Slack via the shared status adapter path. WhatsApp wasn't in that batch.

PR #47513 (closed as superseded) looks like it was going to add this opt-out for WhatsApp.

There's also a separate 30-minute watchdog in the Baileys login path (messageTimeoutMs ?? 1800 * 1e3) that fires for the same reason.

extent analysis

TL;DR

The WhatsApp socket force-reconnects every 30 minutes due to the DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS being too low, causing the health monitor to incorrectly mark the channel as stale.

Guidance

  • The issue is caused by the DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS being set to 30 minutes, which is too low for quiet devices.
  • To verify, check the gateway event log for disconnected (499) -> reconnect pairs every 30 minutes.
  • A potential workaround is to raise the DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS to a higher value, such as 24 hours, to reduce the frequency of reconnects.
  • Consider adding skipStaleSocketHealthCheck: true to the WhatsApp status adapter to opt out of the stale socket health check, similar to the Telegram status adapter.

Example

const whatsappStatusAdapter = {
  // ... other properties ...
  skipStaleSocketHealthCheck: true,
};

Notes

The issue only affects secondary WhatsApp setups where the primary phone handles inbound traffic, and the severity is minor with no message loss.

Recommendation

Apply workaround by raising the DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS or adding skipStaleSocketHealthCheck: true to the WhatsApp status adapter, as this is a more targeted solution than upgrading to a potentially non-existent fixed version.

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 [Bug]: WhatsApp channel force-reconnects every 30 minutes on quiet-device sessions [1 comments, 2 participants]