Skip to content

Message loss during WhatsApp channel restart (stale-socket reconnect) #46372

@danielkimtoronto

Description

@danielkimtoronto

Problem

When the WhatsApp health monitor detects a stale socket and restarts the provider, messages in flight are dropped. No retry or delivery confirmation occurs.

Timeline (from logs)

12:23:19 — User sends message
12:23:41 — Gateway detects stale socket, restarts WhatsApp provider
         → "[whatsapp:default] health-monitor: restarting (reason: stale-socket)"
12:23:43 — WhatsApp reconnects
         → "Listening for personal WhatsApp inbound messages"
Result:   Agent response generated but never delivered to WhatsApp

Expected Behavior

  • Messages should be queued during reconnection and sent once the channel is healthy
  • OR: Send a system message to the user indicating temporary unavailability

Actual Behavior

Silent message drop. User sees no response until they send a follow-up.

Environment

  • OpenClaw version: 2026.3.13
  • Channel: WhatsApp (personal)
  • Model: anthropic/claude-sonnet-4-5
  • Host: Gateway (local bind)

Reproduction

  1. Wait for WhatsApp health monitor to detect stale socket (~5 min idle)
  2. Send a message that triggers a tool call + response
  3. Observe: response never reaches WhatsApp

Suggested Fix

Add message delivery retry logic with exponential backoff when channel state is reconnecting. Queue outbound messages until channel confirms readiness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions