Skip to content

Discord plugin fails to auto-reconnect after WebSocket connection error #30514

@yedianyang

Description

@yedianyang

Description

When the Discord bot WebSocket connection drops (shows "connection error" in Discord), the plugin does not automatically reconnect. All subsequent messages from Discord channels are not received until manual Gateway restart.

Steps to Reproduce

  1. OpenClaw running with Discord plugin enabled
  2. Discord WebSocket connection drops (network issue, Discord API hiccup, etc.)
  3. Discord shows "connection error"
  4. User sends messages in configured Discord channels
  5. Bot does not respond to any messages

Expected Behavior

Discord plugin should automatically detect connection loss and attempt to reconnect (with exponential backoff).

Actual Behavior

  • Connection loss is not detected
  • No reconnection attempts
  • Bot remains in "zombie" state (appears online but receives no messages)
  • Manual Gateway restart (openclaw restart) is required to restore functionality

Environment

  • OpenClaw version: 2026.2.25
  • Node version: v22.22.0
  • OS: macOS 15.1 (Darwin 25.1.0, arm64)
  • Discord config: streaming: off, groupPolicy: allowlist

Workaround

Run openclaw restart when connection error is noticed.

Alternatively, set up a periodic health check script that:

  1. Tests Discord connection every 15 minutes
  2. Automatically restarts Gateway if connection fails
  3. Sends notification to user

Logs

No error logs are produced when connection drops. openclaw status shows Discord │ ON │ OK even when not receiving messages.

Suggested Fix

Implement WebSocket heartbeat monitoring and automatic reconnection logic in the Discord plugin, similar to how Telegram handles connection drops.

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