openclaw - 💡(How to fix) Fix [Bug]: WhatsApp watchdog MESSAGE_TIMEOUT_MS (30min) not configurable — causes reconnect loops on low-traffic setups [1 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#53698Fetched 2026-04-08 01:24:39
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
1
Participants

The WhatsApp web monitor watchdog has a hardcoded MESSAGE_TIMEOUT_MS of 30 minutes (1800s). On low-traffic setups (e.g., DM-only with dmPolicy: allowlist), it's common to go hours without inbound messages. The watchdog treats this as a dead connection and force-closes it with status 499 ("watchdog-timeout"), triggering reconnect loops that eventually escalate to 440 (session conflict).

Error Message

12:47:14 [whatsapp] No messages received in 150m - restarting connection
12:47:15 [whatsapp] Web connection closed (status 499). Retry 1/12 in 2.19s… (status=499)
12:47:18 [whatsapp] Listening for personal WhatsApp inbound messages.
12:48:18 [whatsapp] No messages received in 151m - restarting connection
... (repeats every 60s)
12:53:41 [whatsapp] Web connection closed (status 440: session conflict)

Root Cause

In channel.runtime-Cu2TxQlg.js (line ~2531):

const MESSAGE_TIMEOUT_MS = tuning.messageTimeoutMs ?? 1800 * 1e3;
const WATCHDOG_CHECK_MS = tuning.watchdogCheckMs ?? 60 * 1e3;

The WebMonitorTuning type defines messageTimeoutMs and watchdogCheckMs as optional, but no config path in openclaw.json exposes them. The tuning object is passed as {} from the gateway, so the 30-minute default always wins.

Fix Action

Workaround

Gateway restart resets the lastInboundAt timer, temporarily clearing the loop. But it recurs after the next 30-minute idle window.

Code Example

const MESSAGE_TIMEOUT_MS = tuning.messageTimeoutMs ?? 1800 * 1e3;
const WATCHDOG_CHECK_MS = tuning.watchdogCheckMs ?? 60 * 1e3;

---

12:47:14 [whatsapp] No messages received in 150m - restarting connection
12:47:15 [whatsapp] Web connection closed (status 499). Retry 1/12 in 2.19s… (status=499)
12:47:18 [whatsapp] Listening for personal WhatsApp inbound messages.
12:48:18 [whatsapp] No messages received in 151m - restarting connection
... (repeats every 60s)
12:53:41 [whatsapp] Web connection closed (status 440: session conflict)
RAW_BUFFERClick to expand / collapse

Summary

The WhatsApp web monitor watchdog has a hardcoded MESSAGE_TIMEOUT_MS of 30 minutes (1800s). On low-traffic setups (e.g., DM-only with dmPolicy: allowlist), it's common to go hours without inbound messages. The watchdog treats this as a dead connection and force-closes it with status 499 ("watchdog-timeout"), triggering reconnect loops that eventually escalate to 440 (session conflict).

Root Cause

In channel.runtime-Cu2TxQlg.js (line ~2531):

const MESSAGE_TIMEOUT_MS = tuning.messageTimeoutMs ?? 1800 * 1e3;
const WATCHDOG_CHECK_MS = tuning.watchdogCheckMs ?? 60 * 1e3;

The WebMonitorTuning type defines messageTimeoutMs and watchdogCheckMs as optional, but no config path in openclaw.json exposes them. The tuning object is passed as {} from the gateway, so the 30-minute default always wins.

Environment

  • OS: Ubuntu 22.04 (DigitalOcean VPS)
  • OpenClaw: 2026.3.23-2
  • Node: v22.22.0
  • Config: channels.whatsapp.dmPolicy: allowlist, single allowed number

Steps to Reproduce

  1. Configure WhatsApp with dmPolicy: allowlist and a single allowed number
  2. Start gateway
  3. Wait ~30 minutes without sending any WhatsApp messages
  4. Observe watchdog firing every 60s, force-closing the connection with 499

Logs

12:47:14 [whatsapp] No messages received in 150m - restarting connection
12:47:15 [whatsapp] Web connection closed (status 499). Retry 1/12 in 2.19s… (status=499)
12:47:18 [whatsapp] Listening for personal WhatsApp inbound messages.
12:48:18 [whatsapp] No messages received in 151m - restarting connection
... (repeats every 60s)
12:53:41 [whatsapp] Web connection closed (status 440: session conflict)

Expected Behavior

Either:

  1. Make messageTimeoutMs configurable via channels.whatsapp.messageTimeoutMs (or plugins.entries.whatsapp.config.messageTimeoutMs)
  2. Disable the watchdog by default for allowlist DM-only setups where long idle periods are normal
  3. Increase the default significantly (e.g., 24h) — a 30-minute timeout is unreasonable for a personal assistant bot

Workaround

Gateway restart resets the lastInboundAt timer, temporarily clearing the loop. But it recurs after the next 30-minute idle window.

Related Issues

  • #25591 (440 non-retryable fix — merged, but doesn't prevent the 499 watchdog loop that causes it)
  • #16270 (circuit breaker for reconnect loops)
  • #30806 (outbound messages lost during disconnect windows)

extent analysis

Fix Plan

To address the issue, we will make the messageTimeoutMs configurable via channels.whatsapp.messageTimeoutMs in openclaw.json. Here are the steps:

  • Update the WebMonitorTuning type to include a default value for messageTimeoutMs that can be overridden by the config.
  • Add a config path in openclaw.json to expose messageTimeoutMs.
  • Update the channel.runtime-Cu2TxQlg.js file to use the configured value.

Code Changes

// Update WebMonitorTuning type
interface WebMonitorTuning {
  messageTimeoutMs?: number;
  watchdogCheckMs?: number;
}

// Add config path in openclaw.json
{
  "channels": {
    "whatsapp": {
      "dmPolicy": "allowlist",
      "messageTimeoutMs": 86400000 // 24 hours
    }
  }
}

// Update channel.runtime-Cu2TxQlg.js
const MESSAGE_TIMEOUT_MS = tuning.messageTimeoutMs ?? 86400000; // default to 24 hours
const WATCHDOG_CHECK_MS = tuning.watchdogCheckMs ?? 60 * 1e3;

Verification

To verify the fix, follow these steps:

  1. Update the openclaw.json file with the new config path.
  2. Restart the gateway.
  3. Wait for a period longer than the configured messageTimeoutMs without sending any WhatsApp messages.
  4. Check the logs to ensure the watchdog is not firing and the connection is not being force-closed.

Extra Tips

  • Consider increasing the default messageTimeoutMs value to a more reasonable time frame, such as 24 hours, to prevent unnecessary reconnect loops.
  • Review related issues (#25591, #16270, #30806) to ensure this fix does not introduce any new problems.

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 watchdog MESSAGE_TIMEOUT_MS (30min) not configurable — causes reconnect loops on low-traffic setups [1 participants]