openclaw - 💡(How to fix) Fix WhatsApp relink succeeds, then send fails with No active listener and session drops (401) [8 comments, 4 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#51012Fetched 2026-04-08 01:05:34
View on GitHub
Comments
8
Participants
4
Timeline
12
Reactions
0
Timeline (top)
commented ×8mentioned ×2subscribed ×2
RAW_BUFFERClick to expand / collapse

Bug: WhatsApp relink succeeds, then listener is unavailable and session logs out (401)

Environment

  • OpenClaw: 2026.3.13 (61d171a)
  • OS: Windows
  • Date: 2026-03-20
  • Channel: WhatsApp (default)

Reproduction

  1. openclaw channels login --channel whatsapp --account default
  2. Scan QR in WhatsApp Linked Devices.
  3. CLI shows Linked after restart; web session ready.
  4. Immediately run: openclaw message send --channel whatsapp --target <number> --message "test" --json

Actual

  • Send fails: No active WhatsApp Web listener (account: default)
  • Logs show repeated session drops and exits with 401 Unauthorized / Connection Failure.

Expected

  • After successful link, listener should remain active and sending should succeed.

Attachments

Please attach: debug-bundle-20260320-132717.zip

Local Debug Bundle: C:\Users\pc.openclaw\debug-bundle-20260320-132717.zip (available locally; can be uploaded on request)

extent analysis

Fix Plan

The fix involves modifying the WhatsApp listener to handle session drops and implement retry logic for sending messages.

Step-by-Step Solution

  • Update the openclaw configuration to include a retry mechanism for WhatsApp message sending:
# config.py
WHATSAPP_RETRY_COUNT = 3
WHATSAPP_RETRY_DELAY = 5  # seconds
  • Modify the openclaw WhatsApp listener to handle session drops and implement retry logic:
# whatsapp_listener.py
import time

def send_message(message, target, retry_count=WHATSAPP_RETRY_COUNT, retry_delay=WHATSAPP_RETRY_DELAY):
    for attempt in range(retry_count):
        try:
            # Send message logic here
            return True
        except Exception as e:
            if attempt < retry_count - 1:
                time.sleep(retry_delay)
            else:
                raise Exception(f"Failed to send message after {retry_count} attempts: {str(e)}")
  • Update the openclaw CLI to use the modified WhatsApp listener:
# cli.py
from whatsapp_listener import send_message

def send_whatsapp_message(args):
    # ...
    send_message(args.message, args.target)

Verification

To verify the fix, repeat the reproduction steps and check if the message is sent successfully after relinking the WhatsApp account.

Extra Tips

  • Make sure to handle exceptions and errors properly in the retry logic to avoid infinite loops.
  • Consider implementing a backoff strategy for retry delays to avoid overwhelming the WhatsApp API.
  • Review the debug-bundle-20260320-132717.zip for any additional error logs or clues that may help improve the fix.

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