Skip to content

Discord plugin: channels added to channels.discord.guilds.*.channels.* post-startup are never subscribed (requires full gateway restart) #90865

Closed as not planned

Description

@robertoronderosjr

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

  1. Start an OpenClaw gateway with a configured Discord channel (existing channelId known to receive messages).
  2. While the gateway is running, add a new Discord channel entry to the same guild's channels.<newChannelId> map with enabled: true, requireMention: false, a users allowlist, and a systemPrompt. Save openclaw.json to disk.
  3. 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 reload admin command that rebuilds the allowlist without a full gateway restart.

Related

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

Activity

  1. clawsweeper commented on Jun 6, 2026

    @clawsweeper
    Contributor

    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.discord restart path that was not proven failing here.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    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.discord restart 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:

    • No live Discord reproduction was run against current main or v2026.6.9, so the missed link remains uncertain: config watcher/diffing, reload deferral, channel stop/start, provider startup, account state, or Discord gateway behavior.
    • A prior same-problem issue was closed from source-level generic reload evidence, but this newer report says the behavior still failed in v2026.6.1, so code-path presence alone is not enough to close again.
    • A repair should avoid widening Discord authorization or adding a new reload command before proving the existing reload-to-channel-restart path is insufficient.

    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:

    • Live issue state: GitHub shows this issue open with no assignees, no closing PR references found by searching for this issue number, and current labels requesting maintainer review and more information.
    • Discord declares config hot reload: The Discord channel plugin registers channels.discord as 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)
    • Gateway planner maps plugin prefixes to channel restart: Channel plugin reload prefixes are converted to restart-channel:<plugin.id> actions, which add the channel id to plan.restartChannels. (src/gateway/config-reload-plan.ts:168, bda05dbc2f15)
    • Hot reload handler restarts planned channels: The hot reload handler stops and starts each channel in 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)
    • Discord provider captures allowlist at startup: Discord resolves guild/channel allowlist config during provider startup and passes guildEntries into 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)
    • Existing tests cover generic restart, not this live Discord path: Current tests assert provider config changes schedule channel restarts and that a Discord restart calls stop/start, but I did not find focused coverage proving a newly added channels.discord.guilds.*.channels.* entry receives inbound Discord messages without full gateway restart. (src/gateway/config-reload.test.ts:209, bda05dbc2f15)

    Likely related people:

    • steipete: GitHub path history shows repeated recent work on Discord provider, allowlist, docs, and shared config surfaces that own the inbound allowlist snapshot behavior. (role: Discord allowlist and provider adjacent contributor; confidence: medium; commits: 23716de4468b, 827b0de0ce74, c4412c6b0cbf; files: extensions/discord/src/shared.ts, extensions/discord/src/monitor/provider.ts, extensions/discord/src/monitor/provider.allowlist.ts)
    • vincentkoc: Recent commits touch 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)
    • IWhatsskill: Recent auth-cooldown reload work is adjacent to the same planner semantics that decide hot reload versus restart behavior. (role: adjacent gateway reload contributor; confidence: low; commits: f59113cfd301; files: src/gateway/config-reload-plan.ts)
    • pgondhi987: GitHub path history shows work on Discord allowlist resolution behavior near the provider allowlist code involved in startup snapshot construction. (role: Discord allowlist contributor; confidence: low; commits: ff80167e5a29; files: extensions/discord/src/monitor/provider.allowlist.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2Normal backlog priority with limited blast radius.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.
    and removed
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Jun 15, 2026
  3. openclaw-barnacle commented on Jul 6, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  4. openclaw-barnacle commented on Jul 14, 2026

    @openclaw-barnacle

    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.

  5. locked as resolved and limited conversation to collaborators on Aug 30, 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

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-infoClawSweeper needs more reporter information before it can verify this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions