Skip to content

Discord channel: gateway WebSocket never reaches ready on 2026.5.2 and 2026.5.3 — inbound messageCreate events never dispatch #77526

Closed

Description

@sacred8-Dev

Summary

After updating from openclaw@2026.3.24 to 2026.5.2 (and confirmed still broken on 2026.5.3), the Discord channel never finishes its WebSocket gateway handshake. The bot logs discord client initialized as <id>; awaiting gateway readiness and then nothing further. No messageCreate events ever fire, so the agent never wakes when users send Discord messages.

Outbound text (sending messages from the bot) works fine.
Inbound dispatch (receiving messages from Discord) is silently broken — no error, no timeout, no reconnect.

Affected versions

  • openclaw@2026.5.2 ✗
  • @openclaw/discord@2026.5.2 ✗
  • openclaw@2026.5.3 ✗
  • @openclaw/discord@2026.5.3 ✗ (note: 2026.5.3 changelog mentions plugin install hardening but not this issue)

Last working version

openclaw@2026.3.24 + bundled discord channel — fully working inbound + outbound.

Environment

  • Host: macOS (Apple Silicon, Mac mini)
  • Node: v25.9.0
  • Install: global npm (/opt/homebrew/lib/node_modules/openclaw and @openclaw/discord)
  • Gateway runs as a LaunchAgent
  • Discord bot intents: MESSAGE CONTENT (limited) enabled (un-verified bot, <100 servers)
  • Discord network reachability verified:
    • GET https://discord.com/api/v10/gateway → 200 in ~90ms
    • GET https://discord.com/api/v10/gateway/bot (with bot token) → 200 with valid session_start_limit (986/1000 remaining)

What we see in the log

After openclaw gateway restart:

[gateway] http server listening (1 plugin: discord)
[gateway] gateway ready
[channels/discord] [default] starting provider (@<bot_name>)
[channels/discord] discord channels resolved: <guild>/<channel> (...)
[channels/discord] discord users resolved: <user_id>
[channels/discord] discord channel users resolved: <user_id>
[channels/discord] discord client initialized as <bot_id>; awaiting gateway readiness

Then silence. No additional channels/discord log lines appear — not even after sending real Discord messages from a known-allowlisted user in an allowlisted channel.

openclaw channels status reports Discord default: enabled, configured, running, connected, bot:@<name>, token:config, intents:content=limited — i.e., it self-reports "connected" but the gateway never finishes the READY opcode handshake.

Reproduction steps

  1. npm install -g openclaw@2026.5.3 @openclaw/discord@2026.5.3
  2. Configure a Discord channel with a valid bot token, an allowlisted guild, channel, and user.
  3. openclaw gateway restart
  4. Wait 30+ seconds.
  5. Send a Discord message from the allowlisted user in the allowlisted channel.
  6. Observe: no inbound event in the gateway log; the agent never wakes.

Additional notes

  • I previously hit a separate but related issue where ~/.openclaw/npm/node_modules/@openclaw/discord was a source-only package (only .ts files, no dist/). The 2026.5.3 install hardening flagged it (installed plugin package requires compiled runtime output for TypeScript entry setup-entry.ts). I cleaned it (npm install @openclaw/discord@2026.5.3 --no-save in ~/.openclaw/npm) and the warning went away — but the inbound regression persisted, so it appears unrelated.
  • The bot token works: users/@me had been timing out at ~2.5s on 2026.5.2 in earlier sessions, but a direct curl to /gateway/bot with the bot token returns 200 quickly. So this is not a network or token issue.
  • An outbound send (announce-mode cron job) succeeds and delivers, confirming the REST path is healthy.
  • I tried disabling channels.discord.voice.enabled and switching messages.tts.auto from always → tagged (those changes were needed to fix a separate discordVoice outbound adapter is unavailable cron-delivery error) — neither affected inbound.

Workaround

Heartbeat polling at 1m or 1h instead of WebSocket-driven inbound. This keeps the agent reachable but adds substantial token cost and latency.

What would help diagnose

  • A way to enable verbose debug logging on the Discord gateway WebSocket frames (current openclaw channels logs --channel discord filter returns "No matching log lines" even when there are clearly channels/discord lines in the raw log file — that filter looks broken too).
  • Confirmation whether anyone else with intents.content=limited (un-verified bot, <100 servers) is hitting the same regression, or whether it's specific to that intent configuration.

Activity

  1. clawsweeper commented on May 4, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

    Summary
    Keep open: this is a concrete shipped Discord regression report, and current main has adjacent readiness/status hardening but not enough proof that the 2026.5.2/2026.5.3 inbound READY hang is fixed.

    Reproducibility: no. The issue includes concrete shipped-package steps, but this review did not have Discord credentials and current-main source inspection did not expose a deterministic failing READY path.

    Next step
    Manual review is appropriate because this is a recent shipped Discord live-regression report with clear symptoms but no current-main or lab reproduction yet.

    Review details

    Best possible solution:

    Keep the issue open and isolate whether the packaged Discord gateway fails before HELLO, IDENTIFY, READY, or listener dispatch; then land a narrow Discord plugin fix with regression coverage and a changelog entry.

    Do we have a high-confidence way to reproduce the issue?

    No. The issue includes concrete shipped-package steps, but this review did not have Discord credentials and current-main source inspection did not expose a deterministic failing READY path.

    Is this the best way to solve the issue?

    Unclear. The maintainable fix likely belongs in the Discord plugin gateway startup/readiness path, but the root cause should be isolated before changing intents, timers, or status semantics.

    Acceptance criteria:

    • pnpm test extensions/discord/src/monitor/provider.lifecycle.test.ts extensions/discord/src/internal/gateway.test.ts
    • pnpm test extensions/discord/src/monitor/gateway-plugin.test.ts extensions/discord/src/channel.test.ts

    What I checked:

    • Issue report: The reporter gives exact affected versions, a last-known-good version, macOS/Node/global npm setup, successful REST/outbound checks, and logs ending at discord client initialized ... awaiting gateway readiness.
    • Discord docs define the expected surface: The Discord channel is documented as ready for DMs and guild channels via the official Discord gateway, so inbound gateway dispatch is established behavior rather than a new feature request. Public docs: docs/channels/discord.md. (docs/channels/discord.md:8, 4820b701a597)
    • Current main readiness handling: Current main waits for gateway.isConnected, restarts once after a startup READY timeout, and records startup-not-ready; this should prevent a silent indefinite startup wait but does not prove the reported live READY hang is fixed. (extensions/discord/src/monitor/provider.lifecycle.ts:340, 4820b701a597)
    • Gateway dispatch path: The internal gateway sends IDENTIFY after HELLO, marks connected only on READY/RESUMED, and dispatches gateway events to the client, so a missing READY event would block the messageCreate listener path described by the reporter. (extensions/discord/src/internal/gateway.ts:320, 4820b701a597)
    • Regression coverage exists for timeout behavior only: Provider lifecycle tests cover restart-on-missing-startup-READY and force-stop-on-runtime-reconnect-without-READY, but they do not reproduce the reporter's Discord live connection never reaching READY on packaged 2026.5.3. (extensions/discord/src/monitor/provider.lifecycle.test.ts:336, 4820b701a597)
    • Adjacent unreleased work: Unreleased changelog entries add degraded Discord transport/status signals and move the startup bot/application probe off the gateway monitor path, but neither entry specifically closes this inbound READY regression. (CHANGELOG.md:42, 4820b701a597)

    Likely related people:

    • @steipete: Recent path history from the GitHub commits API shows repeated Discord gateway lifecycle, readiness, intent, metadata, and internal gateway work on the central files for this report. (role: recent maintainer; confidence: high; commits: 03df3539e934, 3bdaa1ceca29, 78a431ed224b; files: extensions/discord/src/monitor/provider.lifecycle.ts, extensions/discord/src/monitor/gateway-plugin.ts, extensions/discord/src/internal/gateway.ts)
    • @vincentkoc: Recent Discord channel startup/status work and changelog maintenance touch the async probe and transport/status area adjacent to the reported READY/status symptoms. (role: adjacent maintainer; confidence: medium; commits: 8a8a12559df0, 02e3061aa709, 718dffd2f2ea; files: extensions/discord/src/channel.ts, extensions/discord/src/monitor/provider.lifecycle.ts, CHANGELOG.md)

    Remaining risk / open question:

    • The report is against shipped npm packages, while current main is already at the 2026.5.4 development version for the Discord plugin.
    • No live Discord bot credentials were available, so the READY hang and messageCreate dispatch failure could not be verified against Discord.
    • Source inspection shows readiness timeout handling, but the reporter's observed lack of timeout/reconnect still needs root-cause isolation.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 4820b701a597.

  2. steipete commented on May 4, 2026

    @steipete
    Contributor

    Fixed on main in c3c7c2d.

    What changed:

    • Discord REST now uses a Discord-scoped IPv4-first DNS lookup when no proxy is configured.
    • Discord gateway WebSocket startup now uses the same IPv4-first lookup.
    • The REST fetch is wired into the Discord Client constructor so all internal REST consumers use the corrected transport path.

    Verification:

    • pnpm test extensions/discord/src/network-config.test.ts extensions/discord/src/monitor/provider.rest-proxy.test.ts extensions/discord/src/monitor/provider.proxy.test.ts extensions/discord/src/monitor/provider.startup.test.ts
    • Testbox pnpm check:changed passed on tbx_01kqtjzkeacz6kasastnpg95qf

    Closing as fixed.

  3. locked as resolved and limited conversation to collaborators on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions