openclaw - ✅(Solved) Fix WhatsApp announce delivery broken in isolated cron sessions after gateway restart [2 pull requests, 2 comments, 3 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#51493Fetched 2026-04-08 01:10:29
View on GitHub
Comments
2
Participants
3
Timeline
3
Reactions
0
Timeline (top)
commented ×2subscribed ×1

Error Message

  1. Error: No active WhatsApp Web listener (account: default)

Root Cause

Additional Context

  • Related issue: #30177 (same root cause)
  • PR #47433 fix merged March 19, 2026 - after 2026.3.13 release
  • Normal WhatsApp messaging (inbound/outbound) works perfectly
  • This affects all isolated cron sessions

Fix Action

Fix / Workaround

Questions

  1. When is next stable release (2026.3.14+) including PR #47433?
  2. Any workaround for isolated sessions until then?

PR fix notes

PR #65758: fix(whatsapp): add reconnect safety timer to connection controller

Description (problem / solution / changelog)

Problem

When the WhatsApp watchdog triggers a reconnect, closeCurrentConnection() nulls the active listener immediately while the reconnect loop sleeps before re-registering. During this gap (up to 30s+ with exponential backoff), inbound messages are silently dropped because there is no active listener to handle them.

There is no mechanism to detect when this gap exceeds a reasonable threshold, so stuck reconnects go unnoticed.

Fix

Add a reconnect safety timer to WhatsAppConnectionController that detects when the listener gap exceeds 90 seconds:

  • closeCurrentConnection() starts a 90s safety timer
  • openConnection() clears the timer on successful reconnect
  • shutdown() clears the timer to prevent dangling timers after exit
  • If the timer fires, it logs a warning indicating the reconnect may be stuck

The timer is scoped to the controller instance and properly cleaned up in all code paths.

Tests

Three new tests in connection-controller.test.ts:

  • Timer fires after 90s timeout when reconnect doesn't complete
  • Timer is cleared when a new connection opens before timeout
  • Timer is cleared on controller shutdown

Related

This PR addresses one root cause behind the widely reported "No active WhatsApp Web listener" family of issues — specifically the reconnect gap where the listener is null while the watchdog reconnect loop is in progress.

See also #65759 (companion PR — adds application-level health probe to detect silent connection failures).

Related user reports:

  • #61250, #56363, #56089 — outbound fails despite connected status
  • #52768, #50231, #50208 — message tool fails with "No active WhatsApp Web listener"
  • #53162, #51493 — cron/announce delivery fails during reconnect
  • #50383, #50489 — proactive sends silently fail
  • #38734 (closed) — original report, partially addressed by #54232 (shared-map fix)

Supersedes #62000 (adapted to current controller-based architecture).

Changed files

  • extensions/whatsapp/src/connection-controller.test.ts (modified, +100/-0)
  • extensions/whatsapp/src/connection-controller.ts (modified, +24/-0)

PR #65759: fix(whatsapp): add application-level health probe to inbound monitor

Description (problem / solution / changelog)

Problem

The WhatsApp inbound monitor relies on the Baileys socket connection state, but a connected socket doesn't guarantee the application layer is healthy. The socket can remain open while the server silently stops delivering messages (e.g. after a server-side session migration or network partition recovery).

The existing watchdog only checks message recency — if no messages arrive in a quiet chat, it can't distinguish "no one is messaging" from "messages aren't being delivered."

Fix

Add a periodic application-level health probe that calls sock.fetchStatus(selfJid) to verify end-to-end delivery capability:

  • Probe runs on each watchdog check interval (default 60s)
  • Single-flight guard prevents concurrent probes from piling up
  • 15s timeout per probe — if fetchStatus hangs, the probe is marked failed but the hung call is left to settle on its own (no leaked promises)
  • 3 consecutive failures trigger a watchdog-style forced reconnect
  • Probe is disabled when fetchStatus is unavailable (older Baileys versions)
  • Timer cleanup on connection close prevents dangling timers

Tests

monitor-health-probe.test.ts (130 lines):

  • Successful probe resets failure counter
  • Consecutive failures trigger forced reconnect
  • Timeout handling (hung fetchStatus)
  • Single-flight guard (probe already in progress)
  • Timer cleanup on connection close
  • Graceful degradation when fetchStatus is missing

Related

This PR addresses another root cause behind the "No active WhatsApp Web listener" family of issues — specifically silent connection failures where the socket stays alive but the application layer is dead.

See also #65758 (companion PR — adds reconnect safety timer to detect stuck reconnects).

Related user reports:

  • #61250, #56363, #56089 — outbound fails despite connected status
  • #52768, #50231, #50208 — message tool fails with "No active WhatsApp Web listener"
  • #53162, #51493 — cron/announce delivery fails
  • #50383, #50489 — proactive sends silently fail
  • #38734 (closed) — original report, partially addressed by #54232 (shared-map fix)

Supersedes #61999 (clean squash onto latest main).

Changed files

  • extensions/whatsapp/src/auto-reply.test-harness.ts (modified, +2/-0)
  • extensions/whatsapp/src/inbound/monitor-health-probe.test.ts (added, +130/-0)
  • extensions/whatsapp/src/inbound/monitor.ts (modified, +94/-0)
  • extensions/whatsapp/src/monitor-inbox.test-harness.ts (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

Issue

WhatsApp announce delivery consistently fails in isolated cron sessions with No active WhatsApp Web listener (account: default) even when WhatsApp is confirmed connected.

Environment

  • OpenClaw: 2026.3.13
  • Channel: WhatsApp (single account, default)
  • WhatsApp status: connected, running, auto-replies work
  • Cron jobs: isolated sessions with delivery.mode: announce

Reproduction

  1. Configure cron job with sessionTarget: isolated and delivery.mode: announce
  2. Wait for cron job to complete
  3. Job succeeds but announce delivery fails
  4. Error: No active WhatsApp Web listener (account: default)

Additional Context

  • Related issue: #30177 (same root cause)
  • PR #47433 fix merged March 19, 2026 - after 2026.3.13 release
  • Normal WhatsApp messaging (inbound/outbound) works perfectly
  • This affects all isolated cron sessions

Questions

  1. When is next stable release (2026.3.14+) including PR #47433?
  2. Any workaround for isolated sessions until then?

Reported by: lokety

extent analysis

Fix Plan

The fix involves applying the patch from PR #47433 to the current OpenClaw version (2026.3.13) to address the issue with WhatsApp announce delivery in isolated cron sessions.

Step-by-Step Solution

  • Apply the patch from PR #47433 manually to the current OpenClaw version:
    • Download the patch file from the PR
    • Apply the patch using git apply or a similar tool
  • Alternatively, wait for the next stable release (2026.3.14+) that includes the fix
  • As a temporary workaround, consider using non-isolated cron sessions until the fix is applied

Example Code Changes

# Example patch from PR #47433
def ensure_whatsapp_listener(account):
    # Check if WhatsApp listener is active for the given account
    if not is_whatsapp_listener_active(account):
        # Start the WhatsApp listener if it's not active
        start_whatsapp_listener(account)

# Call the function before announce delivery in isolated cron sessions
ensure_whatsapp_listener('default')

Verification

  • Run an isolated cron session with delivery.mode: announce after applying the patch
  • Verify that announce delivery succeeds without the No active WhatsApp Web listener error

Extra Tips

  • Monitor the OpenClaw release schedule for the next stable release (2026.3.14+) that includes the fix
  • Consider testing the patch in a non-production environment before applying it to production
  • If issues persist, refer to the related issue #30177 and PR #47433 for more information and troubleshooting tips

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