openclaw - 💡(How to fix) Fix Discord Gateway never reaches READY state — thread creation fails (ACP thread binding broken) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#55569Fetched 2026-04-08 01:37:52
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

After Gateway startup, Discord adapter logs "awaiting gateway readiness" but never logs a READY completion event. This prevents:

  • Automatic thread creation via sessions_spawn with thread: true
  • ACP session delivery context binding (sessions show channel: "unknown" and no deliveryContext)

Message sending and receiving works fine — the bot responds to messages in channels. Only thread creation and thread-bound ACP sessions are affected.

Error Message

[discord] [default] starting provider (@OpenClaw_MannyMain)
[discord] channels resolved: guild:XXXXX→XXXXX (guild:Workspace)
[discord] channel users resolved: XXXXX→XXXXX
[discord] native commands using Carbon reconcile path
[discord] client initialized as XXXXX (OpenClaw_MannyMain); awaiting gateway readiness

No ready log ever follows.

Root Cause

After Gateway startup, Discord adapter logs "awaiting gateway readiness" but never logs a READY completion event. This prevents:

  • Automatic thread creation via sessions_spawn with thread: true
  • ACP session delivery context binding (sessions show channel: "unknown" and no deliveryContext)

Message sending and receiving works fine — the bot responds to messages in channels. Only thread creation and thread-bound ACP sessions are affected.

Fix Action

Fix / Workaround

Workaround confirmed

  • Discord REST API works fine (thread creation via curl succeeds)
  • This appears to be a WebSocket gateway READY event issue, not a REST API or token issue

Code Example

[discord] [default] starting provider (@OpenClaw_MannyMain)
[discord] channels resolved: guild:XXXXXXXXXX (guild:Workspace)
[discord] channel users resolved: XXXXXXXXXX
[discord] native commands using Carbon reconcile path
[discord] client initialized as XXXXX (OpenClaw_MannyMain); awaiting gateway readiness

---

[discord] gateway closed with code 4014 (missing privileged gateway intents)

---

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": { "source": "env", "id": "DISCORD_BOT_TOKEN" },
      "threadBindings": {
        "enabled": true,
        "spawnAcpSessions": true
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Discord Gateway never reaches READY state — thread creation fails

Environment

  • OpenClaw: 2026.3.24 (cff6dc9)
  • OS: macOS 26.4 (arm64)
  • Node: 25.8.1
  • Discord.js: (bundled with OpenClaw)
  • Channel: Discord Bot API

Description

After Gateway startup, Discord adapter logs "awaiting gateway readiness" but never logs a READY completion event. This prevents:

  • Automatic thread creation via sessions_spawn with thread: true
  • ACP session delivery context binding (sessions show channel: "unknown" and no deliveryContext)

Message sending and receiving works fine — the bot responds to messages in channels. Only thread creation and thread-bound ACP sessions are affected.

Steps to reproduce

  1. Start OpenClaw Gateway with Discord enabled
  2. Spawn an ACP session: sessions_spawn({ runtime: "acp", agentId: "claude", thread: true, mode: "session", task: "test" })
  3. Observe: Thread appears in Discord with "Session activated" message, but no further output
  4. Check session: channel: "unknown", deliveryContext: undefined

Expected behavior

  • Discord Gateway reaches READY state
  • Thread is created and bound to ACP session
  • ACP output streams to the thread

Actual behavior

  • Gateway logs: [discord] client initialized as <botId> (BotName); awaiting gateway readiness — never completes
  • ACP session completes successfully but output never reaches Discord thread
  • Session has no deliveryContext or threadId

Logs

[discord] [default] starting provider (@OpenClaw_MannyMain)
[discord] channels resolved: guild:XXXXX→XXXXX (guild:Workspace)
[discord] channel users resolved: XXXXX→XXXXX
[discord] native commands using Carbon reconcile path
[discord] client initialized as XXXXX (OpenClaw_MannyMain); awaiting gateway readiness

No ready log ever follows.

Historical errors (Mar 25)

[discord] gateway closed with code 4014 (missing privileged gateway intents)

Intents have since been enabled (all 3 privileged intents ON), but READY still never arrives.

Workaround confirmed

  • Discord REST API works fine (thread creation via curl succeeds)
  • This appears to be a WebSocket gateway READY event issue, not a REST API or token issue

Configuration

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": { "source": "env", "id": "DISCORD_BOT_TOKEN" },
      "threadBindings": {
        "enabled": true,
        "spawnAcpSessions": true
      }
    }
  }
}

extent analysis

Fix Plan

To resolve the Discord Gateway never reaching READY state issue, we need to ensure that the privileged gateway intents are properly enabled and handled.

Here are the steps to fix the issue:

  • Verify that the GUILD_MEMBERS, PRESENCE, and MESSAGE_CONTENT intents are enabled in the Discord Developer Portal.
  • Update the Discord.js library to the latest version to ensure compatibility with the latest Discord API changes.
  • Modify the OpenClaw configuration to include the intents option when creating the Discord client.

Example code:

const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildPresences,
    GatewayIntentBits.MessageContent,
  ],
});

In the OpenClaw configuration, add the following:

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": { "source": "env", "id": "DISCORD_BOT_TOKEN" },
      "intents": [
        "GUILD_MEMBERS",
        "PRESENCE",
        "MESSAGE_CONTENT"
      ],
      "threadBindings": {
        "enabled": true,
        "spawnAcpSessions": true
      }
    }
  }
}

Verification

After applying the fix, restart the OpenClaw Gateway and verify that the Discord Gateway reaches the READY state by checking the logs for the ready event. Additionally, test the thread creation and ACP session delivery context binding to ensure that they are working as expected.

Extra Tips

  • Ensure that the Discord bot token has the necessary permissions and that the bot is a member of the guild with the correct roles.
  • If issues persist, try enabling debug logging in the Discord.js library to get more detailed information about the gateway connection and intent handling.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • Discord Gateway reaches READY state
  • Thread is created and bound to ACP session
  • ACP output streams to the thread

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING