Skip to content

WhatsApp: Messages truncated on 503 disconnect during send #2983

@dmend3z

Description

@dmend3z

Problem

When a WhatsApp Web 503 disconnect occurs while the agent is sending a reply, the message gets truncated mid-stream. The user receives a partial message with no indication it was cut off.

Observed behavior:

  • Agent starts sending a multi-paragraph response
  • WhatsApp Web connection drops (503 Service Unavailable)
  • Gateway reconnects automatically (~3 seconds)
  • User receives only partial message (e.g., just the bullet points from the middle of the response)

Log evidence:

status=503 Service Unavailable Stream Errored (unknown)
WhatsApp Web connection closed (status 503). Retry 1/12 in 2.14s…

Expected Behavior

  • Messages should either be delivered completely or not at all
  • If a message fails mid-send, it should be re-queued after reconnection

Suggested Solutions

  1. Delivery confirmation - Wait for WhatsApp delivery ACK before marking message as sent
  2. Pending message buffer - Queue outbound messages and retry on reconnection failure
  3. Atomic send - Don't stream partial content; buffer full response before sending

Environment

  • Clawdbot version: npm package (latest)
  • WhatsApp Web via Baileys
  • Ubuntu/Linux VPS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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