Skip to content

Discord WSS Gateway never sends Identify after WebSocket opened (Linux) #52372

@laolin5564

Description

@laolin5564

Environment

  • OpenClaw: 2026.3.13 (61d171a)
  • OS: Debian 12 (bookworm), Linux 6.12.18 x86_64
  • Node: 22.16.0
  • Discord plugin: bundled, installed via openclaw plugins install discord

Symptoms

  • REST API works perfectly (fetch-application-id, deploy-commands, fetch-bot-identity all succeed)
  • gateway-debug: WebSocket connection opened appears in logs
  • But gatewayConnected stays false forever — no Identify (op 2) is sent after receiving Hello (op 10)
  • Bot never comes online in Discord, no READY event
  • Eventually WSS closes with code 1006

Verified NOT the issue

  • Network: Direct ws test with same token on same machine: HELLO → IDENTIFY → READY works perfectly in <2s
  • Token: Valid, all 3 Privileged Intents enabled (Presence, Server Members, Message Content)
  • Proxy/TUN: Tested with mihomo TUN mode (transparent proxy). REST + raw WSS both work.
  • Config: Same config structure as a working Mac Mini instance (same OpenClaw version)

Reproduction

  1. Fresh npm install -g openclaw on Linux (no openclaw onboard)
  2. Configure Discord channel with valid bot token
  3. openclaw plugins install discord
  4. Start gateway
  5. Observe: WSS opens but gatewayConnected stays false

Relevant logs

[discord] [default] starting provider (@老林云客服)
[discord] startup [default] fetch-application-id:done 975ms applicationId=... gateway=missing
[discord] startup [default] deploy-rest:put:done 1988ms
[discord] startup [default] gateway-debug 1977ms WebSocket connection opened
[discord] startup [default] fetch-bot-identity:done 2288ms gatewayConnected=false reconnectAttempts=0
[discord] logged in to discord as ... (老林云客服)
# No further gateway logs. No READY, no close, no error.
# After ~4 minutes:
[discord] gateway: WebSocket connection closed with code 1006
[discord] gateway: Attempting resume with backoff: 1000ms after code 1006

Workaround test (confirms token/network are fine)

const ws = require('ws');
const c = new ws.WebSocket('wss://gateway.discord.gg/?v=10&encoding=json');
c.on('message', (d) => {
  const msg = JSON.parse(d.toString());
  if (msg.op === 10) {
    c.send(JSON.stringify({ op: 2, d: { token: TOKEN, intents: 33281, properties: { os: 'linux', browser: 'openclaw', device: 'openclaw' } } }));
  }
  if (msg.t === 'READY') console.log('READY!', msg.d.user.username); // Works!
});

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