openclaw - 💡(How to fix) Fix [Bug]: Discord-awaiting gateway readiness [1 comments, 2 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#75251Fetched 2026-05-01 05:36:13
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
2
Timeline (top)
closed ×1commented ×1labeled ×1mentioned ×1

Error Message

  • "discord client initialized... awaiting gateway readiness" appears every restart
  • "logged in to discord" only ever appears on the FIRST gateway start of a fresh onboard
  • Ollama on remote host returns 200 OK on /api/chat — agent IS getting model responses, just not delivering them to Discord post-restart

Fix Action

Fix / Workaround

Workarounds tried

  • Reset Discord bot token, re-paste in config
  • Verified all 3 Privileged Gateway Intents enabled (Presence, Server Members, Message Content)
  • Switched primary model from hermes3:70b to hermes3:8b (70b had OOM crashes, 8b stable)
  • Cleared session locks
  • Manually fixed openclaw.plugin.json missing channelConfigs metadata (initial blocker)
  • Removed duplicate global Discord plugin install (npm @openclaw/discord 2026.3.13 conflicts with bundled)

Affected: Discord channel users on macOS install Severity: High (blocks all Discord-channel agent use after first restart) Frequency: 100% reproducible across multiple onboard/restart cycles (5+ observed attempts) Consequence: Discord bot becomes unusable. Only workaround is full re-onboard, which doesn't survive a single restart.

Code Example

Key log lines from /tmp/openclaw/openclaw-2026-04-30.log:

First (working) startup:
[gateway/channels/discord] [default] starting provider (@Hera)
[gateway/channels/discord] logged in to discord as 1498577054441148458 (Hera)

After ANY subsequent restart (broken):
[gateway/channels/discord] [default] starting provider (@Hera)
[gateway/channels/discord] discord client initialized as 1498577054441148458 (Hera); awaiting gateway readiness
[gateway/channels/discord] discord gateway: Gateway websocket closed: 1006
[gateway/channels/discord] discord gateway: Gateway reconnect scheduled in Xms (close, resume=true)

"logged in to discord" never reappears. Reconnect loop continues indefinitely.

Pre-existing related issues encountered during install (already worked through):
- openclaw.plugin.json missing channelConfigs metadata blocked initial Discord plugin load
- npm @openclaw/discord 2026.3.13 conflicts with bundled plugin (deprecated, but still installed by onboard wizard)
- All 3 Discord Privileged Gateway Intents enabled (Presence, Server Members, Message Content)
- Bot token rotated and re-applied via openclaw config
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Discord channel: bot stays "awaiting gateway readiness" after gateway restart

Environment

  • OpenClaw version: 2026.4.27
  • Platform: macOS (Apple Silicon, M2 Ultra Mac Studio)
  • Node: 22.22.0
  • Channel: Discord (bundled plugin, after manual update)
  • Provider: Ollama (local, hermes3:8b)

Behavior

First time the gateway starts after openclaw onboard --install-daemon:

  • Discord bot logs in successfully ("logged in to discord as <id>")
  • Bot appears online in Discord
  • @mentions trigger "typing" indicator briefly, then nothing

After ANY subsequent gateway restart (launchctl unload/load):

  • Bot reaches "discord client initialized as <id>; awaiting gateway readiness"
  • "logged in to discord" event NEVER fires again
  • Bot still appears online in Discord (stale presence)
  • @mentions trigger Discord-side typing UI briefly, but no agent activity occurs in logs
  • No reply/send/outbound activity logged
  • Periodic websocket close 1006 + reconnect cycle

Workarounds tried

  • Reset Discord bot token, re-paste in config
  • Verified all 3 Privileged Gateway Intents enabled (Presence, Server Members, Message Content)
  • Switched primary model from hermes3:70b to hermes3:8b (70b had OOM crashes, 8b stable)
  • Cleared session locks
  • Manually fixed openclaw.plugin.json missing channelConfigs metadata (initial blocker)
  • Removed duplicate global Discord plugin install (npm @openclaw/discord 2026.3.13 conflicts with bundled)

Logs

  • "discord client initialized... awaiting gateway readiness" appears every restart
  • "logged in to discord" only ever appears on the FIRST gateway start of a fresh onboard
  • Ollama on remote host returns 200 OK on /api/chat — agent IS getting model responses, just not delivering them to Discord post-restart

Steps to reproduce

  1. Run openclaw onboard --install-daemon (QuickStart, Ollama provider, Local only, hermes3:70b initially, Discord channel via npm download)
  2. Bot logs in successfully — Discord shows green/online
  3. @mention bot in allowed channel — first response works (after model warm-up)
  4. Restart gateway via launchctl unload && launchctl load ~/Library/LaunchAgents/ai.openclaw.gateway.plist
  5. Bot appears online in Discord but no longer responds to @mentions
  6. Logs show "discord client initialized... awaiting gateway readiness" — never resolves to "logged in to discord"

Expected behavior

After gateway restart, Discord bot should re-authenticate and resume responding to @mentions, just like the initial startup.

Actual behavior

After ANY gateway restart, "logged in to discord" event never fires again. Bot displays as online (stale presence), Discord-side typing indicator briefly appears on @mention then stops, no agent activity in logs, no reply sent. Periodic websocket close 1006 + reconnect cycle continues without success. Ollama provider is healthy — direct /api/chat calls return 200 OK from Hera (10.0.1.2) to Kronos Ollama (10.0.1.3). The agent IS receiving model responses on first session, but Discord channel cannot deliver them after restart.

OpenClaw version

2026.4.27

Operating system

Mac OS 26.4.1 macOS (Apple Silicon, M2 Ultra Mac Studio)

Install method

terminal

Model

ollama/hermes3:8b (also reproduced with ollama/hermes3:70b)

Provider / routing chain

openclaw -> ollama (remote, http://10.0.1.3:11434)

Additional provider/model setup details

Ollama running on separate Mac (Kronos) on local Ethernet network. Hera (client) reaches Ollama via OLLAMA_HOST=http://10.0.1.3:11434 set in launchctl + ~/.zprofile. Direct ollama CLI calls from Hera complete in <2sec, confirmed working. Ollama logs show successful 200 OK on /api/chat from Hera's IP throughout the failure window.

Logs, screenshots, and evidence

Key log lines from /tmp/openclaw/openclaw-2026-04-30.log:

First (working) startup:
[gateway/channels/discord] [default] starting provider (@Hera)
[gateway/channels/discord] logged in to discord as 1498577054441148458 (Hera)

After ANY subsequent restart (broken):
[gateway/channels/discord] [default] starting provider (@Hera)
[gateway/channels/discord] discord client initialized as 1498577054441148458 (Hera); awaiting gateway readiness
[gateway/channels/discord] discord gateway: Gateway websocket closed: 1006
[gateway/channels/discord] discord gateway: Gateway reconnect scheduled in Xms (close, resume=true)

"logged in to discord" never reappears. Reconnect loop continues indefinitely.

Pre-existing related issues encountered during install (already worked through):
- openclaw.plugin.json missing channelConfigs metadata blocked initial Discord plugin load
- npm @openclaw/discord 2026.3.13 conflicts with bundled plugin (deprecated, but still installed by onboard wizard)
- All 3 Discord Privileged Gateway Intents enabled (Presence, Server Members, Message Content)
- Bot token rotated and re-applied via openclaw config

Impact and severity

Affected: Discord channel users on macOS install Severity: High (blocks all Discord-channel agent use after first restart) Frequency: 100% reproducible across multiple onboard/restart cycles (5+ observed attempts) Consequence: Discord bot becomes unusable. Only workaround is full re-onboard, which doesn't survive a single restart.

Additional information

First known bad version: 2026.4.27 (only version tested). First-time onboard does work. Issue manifests on every gateway restart afterward. TUI (openclaw tui) reaches the same Ollama provider successfully — issue is isolated to Discord channel post-restart, not the agent/provider layer.

extent analysis

TL;DR

The Discord bot fails to re-authenticate after a gateway restart, causing it to become unresponsive, and a potential fix involves investigating the Discord client initialization and gateway readiness logic.

Guidance

  • Investigate the discord client initialized as <id>; awaiting gateway readiness log message and the subsequent Gateway websocket closed: 1006 error to understand why the bot is unable to re-authenticate after a restart.
  • Verify that the Discord bot token and Privileged Gateway Intents are correctly configured and enabled.
  • Check the OpenClaw documentation and Discord API documentation to ensure that the Discord client initialization and gateway readiness logic is correctly implemented.
  • Consider adding logging or debugging statements to the Discord client initialization code to gain more insight into the issue.

Example

No code example is provided as the issue is more related to the configuration and logic of the Discord client initialization and gateway readiness.

Notes

The issue seems to be specific to the Discord channel and the gateway restart process, and it's not clear if it's related to the OpenClaw version or the Discord API. Further investigation is needed to determine the root cause of the issue.

Recommendation

Apply a workaround by re-onboarding the Discord bot after each gateway restart, although this is not a permanent solution and the root cause of the issue should be investigated and fixed.

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

After gateway restart, Discord bot should re-authenticate and resume responding to @mentions, just like the initial startup.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Discord-awaiting gateway readiness [1 comments, 2 participants]