Repository navigation
Description
Summary
In OpenClaw 2026.6.1, when a new Discord channel is added to channels.discord.guilds.<guildId>.channels.<channelId> in openclaw.json after the gateway has started, the discord plugin never subscribes to inbound events from that channel — even though the config is correct and the plugin can outbound-send to it. A full gateway restart is required for the new channel to become live.
Steps to reproduce
- Start an OpenClaw gateway with a configured Discord channel (existing
channelIdknown to receive messages). - While the gateway is running, add a new Discord channel entry to the same guild's
channels.<newChannelId>map withenabled: true,requireMention: false, ausersallowlist, and asystemPrompt. Saveopenclaw.jsonto disk. - From the new channel, post a message from an allowlisted user.
Expected
The agent receives the inbound event and replies (matches the behavior of any channel present at gateway start).
Actual
- Outbound from the agent into the new channel works (verified — we used it to post a "config repaired" announcement).
- Inbound events from that channel are silently dropped. No log lines at debug, info, or warn for that channel id.
- Logs show repeated gateway WebSocket close events (
gateway: Gateway websocket closed: 1006), and after each reconnect the channel is still not subscribed. - Symptom persists indefinitely until the gateway container is restarted, at which point the plugin re-reads
openclaw.json, the new channel appears in the resolved-channels log line (channels resolved: ...emma-memories... (+3)), and inbound starts working immediately.
Root cause hypothesis
The discord plugin builds its in-memory inbound channel allowlist at gateway-start ([discord] channels resolved: <ids> log line). After that, gateway 1006 reconnects use RESUME (session state preserved) rather than rebuilding the allowlist from disk. Config changes to channels.discord.guilds.*.channels.* are persisted but never re-read by the running plugin.
For comparison, telegram appears to hot-reload on config change (see #68232 / #79487 describing telegram channel-restart-on-config-edit behavior). Discord does not.
Verified workaround
docker restart <gateway-container> (or equivalent) makes the new channel live within ~30s.
Why this matters
Channel-creation is a routine operator action. Bots that can't pick up new channels without a full gateway restart introduce per-channel downtime windows for every other channel during the restart (~30–120s on a real deployment), and create a fragile operator pattern.
Asks
- Hot-reload
channels.discord.guilds.*.channels.*on config change (filesystem watch or polled), OR - Rebuild the channel allowlist on every gateway IDENTIFY (so 1006 reconnects pick up changes), OR
- At minimum, expose a
discord reloadadmin command that rebuilds the allowlist without a full gateway restart.
Related
- [Bug] Config edits trigger Telegram channel restart via hot reload — destroys in-memory context #68232 — Telegram hot-reload behavior (different channel, but the parity reference)
- Channel-reload race: deferred reload + gateway-tool
restartdouble-spawn telegram channel → EADDRINUSE crash loop #79487 — Channel-reload race condition (telegram) - Gateway: account-scoped channel config changes restart the entire channel and can disrupt active traffic #43935 — Account-scoped config restart-on-change (the other side of this trade-off)
- Gateway frequent restarts: config reload too aggressive + auth pre-warm blocks event loop #87285 — Gateway frequent restarts via aggressive reload (cautionary tale for any fix)
Environment
- OpenClaw 2026.6.1 (gateway image
ghcr.io/openclaw/openclaw:2026.6.1) - @openclaw/discord 2026.6.1
- Discord bot has ADMINISTRATOR role in guild (
perms=0x8) — not a permissions issue - MESSAGE_CONTENT intent verified enabled at the application level
- Direct probe to Discord API confirms channels have zero permission_overwrites for the bot
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 6, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 2:18 PM ET / 18:18 UTC.
Summary
Keep open: current main and v2026.6.9 still show only the generic Discord config-edit to channel-restart path, while this later v2026.6.1 report says that path did not make newly added Discord guild channels receive inbound messages; the exact missed link still needs live or focused integration proof before repair.
Reproducibility: no. the reporter gives concrete steps, and source shows a plausible stale provider-startup allowlist if the Discord channel restart is missed, but current main also contains a generic
channels.discordrestart path that was not proven failing here.Ways to help us reproduce this
Next step
Maintainer or live Discord reproduction should come before repair because current source already has a generic reload path, the issue is labeled no-new-fix-pr/needs-info, and the exact failure point is not proven.
Review details
Best possible solution:
Keep this as the Discord-specific canonical report, prove the exact add-channel-while-running flow with live or focused integration evidence, then repair the existing reload-to-provider-start path rather than adding a separate command or pattern syntax first.
Do we have a high-confidence way to reproduce the issue?
No; the reporter gives concrete steps, and source shows a plausible stale provider-startup allowlist if the Discord channel restart is missed, but current main also contains a generic
channels.discordrestart path that was not proven failing here.Is this the best way to solve the issue?
Unclear as a final fix. The narrowest maintainable path is to prove and repair the existing config reload to Discord channel restart path before adding a Discord reload command, reconnect-time config reread, or broader dynamic allowlist feature.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against bda05dbc2f15.
Label changes
Label justifications:
P2: The report describes inbound Discord messages from newly configured channels being dropped until restart, with a workaround and limited channel-addition blast radius.impact:message-loss: The reported failure silently drops inbound Discord messages from a configured guild channel until the gateway or Discord provider is restarted.Evidence reviewed
What I checked:
channels.discordas a reload prefix, so the intended current-main path is a Discord channel restart for matching config edits. (extensions/discord/src/shared.ts:149, bda05dbc2f15)restart-channel:<plugin.id>actions, which add the channel id toplan.restartChannels. (src/gateway/config-reload-plan.ts:168, bda05dbc2f15)channelsToRestart, which should rebuild Discord allowlist state only if this specific config edit reaches the path and the restart succeeds. (src/gateway/server-reload-handlers.ts:487, bda05dbc2f15)guildEntriesinto the created message handler, so a running provider can hold stale channel authorization if it is not restarted after the config edit. (extensions/discord/src/monitor/provider.ts:278, bda05dbc2f15)channels.discord.guilds.*.channels.*entry receives inbound Discord messages without full gateway restart. (src/gateway/config-reload.test.ts:209, bda05dbc2f15)Likely related people:
extensions/discord/src/shared.ts,extensions/discord/src/monitor/provider.ts,extensions/discord/src/monitor/provider.allowlist.ts)src/gateway/config-reload-plan.ts, the central path that converts channel config edits into restart actions. (role: recent gateway reload contributor; confidence: medium; commits: d7d4852e5e34, a682e6481382; files:src/gateway/config-reload-plan.ts)src/gateway/config-reload-plan.ts)extensions/discord/src/monitor/provider.allowlist.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.openclaw-barnacle commentedon Jul 6, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Jul 14, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.