Skip to content

Commit 8e2e4b2

Browse files
fix: ignore discord wildcard audit keys (openclaw#33125) (thanks @thewilloftheshadow) (openclaw#33125)
1 parent c8b45a4 commit 8e2e4b2

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Docs: https://docs.openclaw.ai
1212
### Fixes
1313

1414
- Telegram/DM draft finalization reliability: require verified final-text draft emission before treating preview finalization as delivered, and fall back to normal payload send when final draft delivery is not confirmed (preventing missing final responses and preserving media/button delivery). (#32118) Thanks @OpenCils.
15+
- Discord/audit wildcard warnings: ignore "\*" wildcard keys when counting unresolved guild channels so doctor/status no longer warns on allow-all configs. (#33125) Thanks @thewilloftheshadow.
1516
- Exec heartbeat routing: scope exec-triggered heartbeat wakes to agent session keys so unrelated agents are no longer awakened by exec events, while preserving legacy unscoped behavior for non-canonical session keys. (#32724) thanks @altaywtf
1617
- macOS/Tailscale remote gateway discovery: add a Tailscale Serve fallback peer probe path (`wss://<peer>.ts.net`) when Bonjour and wide-area DNS-SD discovery return no gateways, and refresh both discovery paths from macOS onboarding. (#32860) Thanks @ngutman.
1718
- Telegram/multi-account default routing clarity: warn only for ambiguous (2+) account setups without an explicit default, add `openclaw doctor` warnings for missing/invalid multi-account defaults across channels, and document explicit-default guidance for channel routing and Telegram config. (#32544) thanks @Sid-Qin.

src/discord/audit.test.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,55 @@ describe("discord audit", () => {
5353
expect(audit.channels[0]?.channelId).toBe("111");
5454
expect(audit.channels[0]?.missing).toContain("SendMessages");
5555
});
56+
57+
it("does not count '*' wildcard key as unresolved channel", async () => {
58+
const { collectDiscordAuditChannelIds } = await import("./audit.js");
59+
60+
const cfg = {
61+
channels: {
62+
discord: {
63+
enabled: true,
64+
token: "t",
65+
groupPolicy: "allowlist",
66+
guilds: {
67+
"123": {
68+
channels: {
69+
"111": { allow: true },
70+
"*": { allow: true },
71+
},
72+
},
73+
},
74+
},
75+
},
76+
} as unknown as import("../config/config.js").OpenClawConfig;
77+
78+
const collected = collectDiscordAuditChannelIds({ cfg, accountId: "default" });
79+
expect(collected.channelIds).toEqual(["111"]);
80+
expect(collected.unresolvedChannels).toBe(0);
81+
});
82+
83+
it("handles guild with only '*' wildcard and no numeric channel ids", async () => {
84+
const { collectDiscordAuditChannelIds } = await import("./audit.js");
85+
86+
const cfg = {
87+
channels: {
88+
discord: {
89+
enabled: true,
90+
token: "t",
91+
groupPolicy: "allowlist",
92+
guilds: {
93+
"123": {
94+
channels: {
95+
"*": { allow: true },
96+
},
97+
},
98+
},
99+
},
100+
},
101+
} as unknown as import("../config/config.js").OpenClawConfig;
102+
103+
const collected = collectDiscordAuditChannelIds({ cfg, accountId: "default" });
104+
expect(collected.channelIds).toEqual([]);
105+
expect(collected.unresolvedChannels).toBe(0);
106+
});
56107
});

src/discord/audit.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ function listConfiguredGuildChannelKeys(
5656
if (!channelId) {
5757
continue;
5858
}
59+
// Skip wildcard keys (e.g. "*" meaning "all channels") — they are valid
60+
// config but are not real channel IDs and should not be audited.
61+
if (channelId === "*") {
62+
continue;
63+
}
5964
if (!shouldAuditChannelConfig(value as DiscordGuildChannelConfig | undefined)) {
6065
continue;
6166
}

0 commit comments

Comments
 (0)