Skip to content

Discord bot never reaches ready state — stuck at awaiting gateway readiness (v2026.3.28) #58290

@zach-theochinomona

Description

@zach-theochinomona

Description

Discord bot initializes and authenticates successfully but never completes the gateway lifecycle. The bot shows as offline in Discord and never receives inbound messages. WhatsApp channel works fine on the same gateway.

Environment

  • OpenClaw: v2026.3.28 (f9b1079)
  • Platform: Ubuntu 24.04.4 LTS, Hostinger KVM 2 (8GB RAM)
  • Node: v25.8.1
  • Discord bot: ID 1484866453525237881

Symptoms

  1. Gateway logs repeat indefinitely:
[discord] [default] starting provider (@Zach)
[discord] native commands using Carbon reconcile path
[discord] client initialized as 1484866453525237881 (Zach); awaiting gateway readiness
  1. Bot shows offline in Discord — no presence set
  2. No ready or READY log ever appears
  3. No errors logged — lifecycle fails silently
  4. openclaw channels status reports connected, works
  5. openclaw doctor reports Discord: ok (@Zach) (703ms)
  6. Health monitor eventually restarts channel for stale-socket, creating a restart loop

Verified working

  • REST API: curl -H "Authorization: Bot <token>" https://discord.com/api/v10/users/@me returns valid bot info
  • Gateway WebSocket (raw): Connecting directly with Node.js ws module to wss://gateway.discord.gg/?v=10&encoding=json and sending IDENTIFY with the same token → receives HELLO then READY within 1 second
  • Token: Reset and verified — same behavior with both old and new token
  • Intents: All three privileged intents toggled on in Developer Portal (API still reports limited flags — may be propagation delay, but raw WS test succeeds regardless)
  • Bot membership: Bot is in one guild, confirmed via /users/@me/guilds
  • Session starts remaining: 998/1000

Config (channels.discord section)

{
  "discord": {
    "enabled": true,
    "token": "<redacted>",
    "dmPolicy": "open",
    "allowFrom": ["*"],
    "groupPolicy": "allowlist",
    "streaming": "off"
  }
}

What I've tried

  1. Reset bot token in Developer Portal
  2. Toggled all privileged intents on/off
  3. Set gateway.channelHealthCheckMinutes: 0 to stop restart loop
  4. Added/removed Discord from plugins.load.paths
  5. Added plugins.allow: ["discord"]
  6. Multiple openclaw gateway restart cycles
  7. openclaw doctor --fix
  8. Verified raw Discord gateway WebSocket handshake works from the same server

Root cause hypothesis

The formatDiscordStartupStatusMessage function checks lifecycleGateway?.isConnected which is only set to true when a READY or RESUMED dispatch is received. The runDiscordGatewayLifecycle function is called after the status message but appears to silently fail — no success or error is ever logged. The Discord.js client's login() resolves but the internal gateway supervisor never completes the WebSocket handshake, despite the raw connection working fine from the same process's Node.js runtime.

Expected behavior

Bot should reach ready state, show as online in Discord, and receive DMs/mentions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    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