Description
WhatsApp connections are repeatedly failing with status 440 conflict errors, indicating multiple simultaneous sessions attempting to connect to the same WhatsApp account.
Problem
78 occurrences of connection closed with status 440 conflict errors have been observed during normal operation.
Error Message
Web connection closed (status 440). Retry 1/12 in 2.XXs… (status=440 Unknown Stream Errored (conflict))
Root Cause Hypothesis
Multiple WhatsApp sessions are active simultaneously, creating conflicts:
- OpenClaw gateway's WhatsApp integration attempting to connect
- wacli attempting to connect to the same account
- Multiple QR code scans creating competing sessions
This is consistent with WhatsApp Web's limitation of one active session per account at a time (unless using multi-device mode correctly).
Impact
- Users experience repeated connection failures
- Unreliable WhatsApp message delivery through OpenClaw
- Users must fall back to wacli authentication when OpenClaw WhatsApp integration fails
- Service interruptions during the retry cycle (up to 12 retries)
Environment
- OpenClaw Version: 2026.2.2-3
- Platform: macOS
- Baileys Version: 7.0.0-rc.9
- WhatsApp Integration: Baileys library
Logs Pattern
The logs show a consistent pattern of:
- Connection attempt
- Status 440 conflict error
- Retry with exponential backoff
- Repeated failures across multiple retry attempts
Reproduction Steps
- Start OpenClaw gateway with WhatsApp channel configured
- Scan QR code to link WhatsApp account
- While OpenClaw is connected, attempt to use wacli with the same account
- Observe status 440 conflicts in OpenClaw logs
OR
- Have OpenClaw gateway running with active WhatsApp session
- Scan QR code again without disconnecting previous session
- Observe status 440 conflicts
Expected Behavior
- OpenClaw should detect existing session conflicts
- Clear error message indicating another session is active
- Graceful handling with user-friendly guidance
- Automatic session cleanup when appropriate
Actual Behavior
- Connection repeatedly fails with cryptic status 440 errors
- No clear indication of the conflict cause
- Continuous retry attempts despite fundamental conflict
Suggested Fix
- Implement session conflict detection: Before attempting connection, check for existing active sessions
- Mutual exclusion: Ensure OpenClaw and wacli cannot simultaneously lock the same WhatsApp account
- Clear error messaging: When conflict detected, show actionable error: "Another WhatsApp session is active. Please disconnect other sessions before connecting."
- Session management: Provide CLI command to forcefully disconnect existing sessions
- Health check: Add endpoint to verify WhatsApp session status and conflicts
Related Issues
Labels
bug, whatsapp, priority:high, baileys
Description
WhatsApp connections are repeatedly failing with status 440 conflict errors, indicating multiple simultaneous sessions attempting to connect to the same WhatsApp account.
Problem
78 occurrences of connection closed with status 440 conflict errors have been observed during normal operation.
Error Message
Root Cause Hypothesis
Multiple WhatsApp sessions are active simultaneously, creating conflicts:
This is consistent with WhatsApp Web's limitation of one active session per account at a time (unless using multi-device mode correctly).
Impact
Environment
Logs Pattern
The logs show a consistent pattern of:
Reproduction Steps
OR
Expected Behavior
Actual Behavior
Suggested Fix
Related Issues
Labels
bug,whatsapp,priority:high,baileys