diff --git a/src/config/group-policy.ts b/src/config/group-policy.ts index ae8967192..cea3aed8a 100644 --- a/src/config/group-policy.ts +++ b/src/config/group-policy.ts @@ -110,7 +110,13 @@ export function resolveChannelGroupPolicy(params: { }): ChannelGroupPolicy { const { cfg, channel } = params; const groups = resolveChannelGroups(cfg, channel, params.accountId); - const allowlistEnabled = Boolean(groups && Object.keys(groups).length > 0); + // Only enable allowlist when groupPolicy is explicitly "allowlist". + // This allows explicit group configs (e.g., requireMention) to coexist + // with groupPolicy: "open" without creating an implicit allowlist. + const channelConfig = cfg.channels?.[channel]; + const groupPolicy = channelConfig?.groupPolicy ?? "open"; + const allowlistEnabled = + groupPolicy === "allowlist" && Boolean(groups && Object.keys(groups).length > 0); const normalizedId = params.groupId?.trim(); const groupConfig = normalizedId && groups ? groups[normalizedId] : undefined; const defaultConfig = groups?.["*"];