openclaw - ✅(Solved) Fix Discord: channels block should be additive overrides, not an implicit allowlist [1 pull requests, 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#73387Fetched 2026-04-29 06:20:24
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
cross-referenced ×3commented ×1

Error Message

  1. Is error-prone — forgetting to add a channel means the bot silently ignores it with no obvious error

Fix Action

Fix / Workaround

Adding a channels block with those two channel overrides causes every other channel in the guild to be silently denied. The only workaround is to explicitly list every channel in the config, which:

Current workarounds

PR fix notes

PR #54353: fix(discord): block unconfigured channels under groupPolicy allowlist

Description (problem / solution / changelog)

Problem

Fixes #54277

When groupPolicy: allowlist is set on a Discord guild and at least one channel is explicitly configured in channels, any channel not in the channels config is incorrectly allowed through.

Root cause

// message-handler.preflight.ts
const channelAllowed = channelConfig?.allowed !== false;

When channelConfig is undefined (channel not configured), undefined !== false evaluates to true, so channelAllowed = true. This causes isDiscordGroupAllowedByPolicy to treat the channel as allowlisted.

Fix

When an allowlist is configured (channelAllowlistConfigured = true), require explicit allow: true for a channel to be considered matched. For unconfigured guilds (no channel config at all), keep the old behaviour to avoid breaking the no-allowlist case.

// After
const channelAllowed = channelAllowlistConfigured
  ? channelConfig?.allowed === true
  : channelConfig?.allowed !== false;

Changes

  • extensions/discord/src/monitor/message-handler.preflight.ts: 6-line logic fix
  • extensions/discord/src/monitor/message-handler.preflight.test.ts: 36-line regression test

Test

New test: "drops guild messages from unconfigured channels when allowlist is configured (issue #54277)"

All 21 existing preflight tests continue to pass.

Changed files

  • extensions/discord/src/monitor/message-handler.preflight.test.ts (added, +874/-0)
  • extensions/discord/src/monitor/message-handler.preflight.ts (added, +952/-0)

Code Example

{
  "guilds": {
    "<guild_id>": {
      "requireMention": false,
      "groupPolicy": "open",
      "channels": {
        "<channel_id_1>": { "requireMention": true },
        "<channel_id_2>": { "requireMention": true }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

When a Discord guild config includes a channels block to set per-channel overrides (e.g., requireMention: true on specific channels), all non-listed channels are implicitly denied. This is documented behavior ("if a guild has channels configured, non-listed channels are denied"), but it creates an impractical configuration model.

What we want

  • Bot listens and responds in all channels in the guild (groupPolicy: "open")
  • Two specific channels (#system-administration, #agent-design) have requireMention: true — the bot only responds there when @mentioned
  • All other channels use the guild-level defaults (requireMention: false)

What happens

Adding a channels block with those two channel overrides causes every other channel in the guild to be silently denied. The only workaround is to explicitly list every channel in the config, which:

  1. Breaks when new channels are created — they are omitted by default until manually added to the config
  2. Requires a config update + gateway restart for every new channel
  3. Is error-prone — forgetting to add a channel means the bot silently ignores it with no obvious error
  4. Scales poorly — a guild with 20+ channels needs 20+ config entries just to override 2

Expected behavior

The channels block should act as additive per-channel overrides on top of the guild-level config, not as an implicit allowlist. Non-listed channels should inherit the guild-level defaults (groupPolicy, requireMention, users, etc.) rather than being denied.

Suggested config semantics

{
  "guilds": {
    "<guild_id>": {
      "requireMention": false,
      "groupPolicy": "open",
      "channels": {
        "<channel_id_1>": { "requireMention": true },
        "<channel_id_2>": { "requireMention": true }
      }
    }
  }
}

In this model:

  • Channels listed in channels get their settings merged with guild defaults
  • Channels not listed inherit guild defaults and are not denied
  • The channels block is purely for overrides, not for access control

Current workarounds

  1. Remove the channels block entirely — loses the ability to set per-channel overrides
  2. List every channel explicitly — fragile, does not scale, breaks on new channel creation
  3. Use bot-level NO_REPLY logic — unreliable (see related issue with internal monologue leaking)

Related issues

  • #69748 (access lists with per-channel overrides) — broader scope, addresses user-level overrides
  • #39661 (per-user mention policy) — addresses per-user granularity
  • #8972 (pattern-based channel allowlist) — addresses dynamic channel matching

This issue is specifically about the default deny semantics of the channels block, which is a prerequisite behavior change that would benefit all of the above.

Environment

  • OpenClaw version: current main (fork)
  • Channel: Discord
  • Config: groupPolicy: "open" with guild-level requireMention: false

extent analysis

TL;DR

The most likely fix is to update the configuration semantics to use additive per-channel overrides, allowing non-listed channels to inherit guild-level defaults.

Guidance

  • Review the suggested config semantics to understand the proposed solution, which involves merging channel settings with guild defaults for listed channels and inheriting guild defaults for non-listed channels.
  • Consider the implications of the current channels block behavior, where non-listed channels are implicitly denied, and how it affects the bot's functionality in different channels.
  • Evaluate the current workarounds, such as removing the channels block or listing every channel explicitly, and their limitations.
  • Investigate related issues, like #69748, #39661, and #8972, to understand the broader context and potential solutions.

Example

{
  "guilds": {
    "<guild_id>": {
      "requireMention": false,
      "groupPolicy": "open",
      "channels": {
        "<channel_id_1>": { "requireMention": true },
        "<channel_id_2>": { "requireMention": true }
      }
    }
  }
}

This example illustrates the proposed configuration semantics, where channels listed in the channels block have their settings merged with guild defaults, and non-listed channels inherit guild defaults.

Notes

The solution requires a behavior change in the channels block, which may involve updates to the OpenClaw configuration parser and the bot's logic for handling channel overrides. The proposed solution aims to provide a more practical and scalable configuration model.

Recommendation

Apply the suggested config semantics to update the channels block behavior, allowing non-listed channels to inherit guild-level defaults. This change will enable the bot to listen and respond in all channels in the guild while still allowing per-channel overrides.

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

The channels block should act as additive per-channel overrides on top of the guild-level config, not as an implicit allowlist. Non-listed channels should inherit the guild-level defaults (groupPolicy, requireMention, users, etc.) rather than being denied.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING