-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
WhatsApp: Messages silently dropped during reconnection window #14827
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Problem
When a WhatsApp Web disconnect occurs (408/503), messages sent during the ~3-5 second reconnection window are silently dropped. The agent receives no error feedback and believes the message was delivered.
Observed behavior:
- WhatsApp gateway disconnects (status 408)
- Gateway reconnects automatically (~3-5 seconds)
- Agent's reply is generated during this window
sendWithRetryindeliver-reply.tstries 3 times with short backoffs (500ms/1s/1.5s = 3s total)- All retries fail with 'Connection Closed' because reconnection takes longer
onErrorcallback inprocess-message.tslogs the error and swallows it- Agent continues as if message was sent successfully
- User never receives the reply
Log evidence:
WhatsApp gateway disconnected (status 408)
WhatsApp gateway connected.
Failed sending web auto-reply to <jid>: Connection Closed
Related: #2983 (same root issue, closed as stale without fix)
Root Cause
Two issues in the delivery pipeline:
-
src/web/auto-reply/deliver-reply.ts—sendWithRetry()maxAttempts=3 with linear backoff (500ms × attempt). Total retry window ~3s, but reconnection takes ~3-5s. Retries are exhausted before connection is restored. -
src/web/auto-reply/monitor/process-message.ts—onErrorcallback only logs the error. No re-queue, no delivery failure notification to the agent, no system event.
Suggested Fix
- Increase
sendWithRetryattempts from 3→5 and backoff from500*attempt→1000*attemptms (total window ~10s, covers reconnection) - Surface delivery failures as system events so the agent knows the message wasn't delivered
Environment
- OpenClaw v0.40.4
- WhatsApp Web via Baileys
- Ubuntu/Linux VPS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.