Skip to content

Discord: false positive 'unresolvedChannels' warning when using '*' wildcard in guild channels #32517

@ChrisThompsonTLDR

Description

@ChrisThompsonTLDR

Summary

openclaw doctor and channels status --probe report a false positive when using the * wildcard in channels.discord.guilds.*.channels:

Some configured guild channels are not numeric IDs (unresolvedChannels=1).
Permission audit can only check numeric channel IDs.

The * key is a valid config meaning "allow all channels" in the guild. It is already handled correctly by the allowlist logic (e.g. provider.allowlist.ts filters key !== "*"). The audit should not count it as unresolved.

Config that triggers the warning

{
  "channels": {
    "discord": {
      "guilds": {
        "1478116902202114240": {
          "channels": {
            "*": { "allow": true }
          }
        }
      }
    }
  }
}

Root cause

In src/discord/audit.ts, collectDiscordAuditChannelIds counts all non-numeric keys as unresolved:

const channelIds = keys.filter((key) => /^\d+$/.test(key));
const unresolvedChannels = keys.length - channelIds.length;

The * wildcard is not numeric, so it gets counted even though it is intentional and valid.

Suggested fix

Exclude known wildcard keys from the unresolved count:

const CHANNEL_WILDCARD_KEYS = new Set(["*"]);
// ...
const channelIds = keys.filter((key) => /^\d+$/.test(key));
const wildcardKeys = keys.filter((key) => CHANNEL_WILDCARD_KEYS.has(key));
const unresolvedChannels = Math.max(0, keys.length - channelIds.length - wildcardKeys.length);

Environment

  • OpenClaw 2026.3.1-beta.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions