
























@@ -1,10 +1,14 @@
11import type { OpenClawConfig } from "../../../config/types.openclaw.js";
2-import { listExplicitConfiguredChannelIdsForConfig } from "../../../plugins/channel-plugin-ids.js";
2+import {
3+listExplicitConfiguredChannelIdsForConfig,
4+resolveConfiguredChannelPresencePolicy,
5+} from "../../../plugins/channel-plugin-ids.js";
36import {
47normalizePluginsConfig,
58resolveEffectivePluginActivationState,
69} from "../../../plugins/config-state.js";
710import { loadPluginManifestRegistryForPluginRegistry } from "../../../plugins/plugin-registry.js";
11+import { normalizeOptionalLowercaseString } from "../../../shared/string-coerce.js";
812import { sanitizeForLog } from "../../../terminal/ansi.js";
9131014export type ChannelPluginBlockerHit = {
@@ -39,7 +43,11 @@ export function scanConfiguredChannelPluginBlockers(
3943if (!hasExplicitChannelPluginBlockerConfig(cfg)) {
4044return [];
4145}
42-const configuredChannelIds = new Set(listExplicitConfiguredChannelIdsForConfig(cfg));
46+const configuredChannelIds = new Set(
47+listExplicitConfiguredChannelIdsForConfig(cfg)
48+.map((channelId) => normalizeOptionalLowercaseString(channelId))
49+.filter((channelId): channelId is string => Boolean(channelId)),
50+);
4351if (configuredChannelIds.size === 0) {
4452return [];
4553}
@@ -50,6 +58,16 @@ export function scanConfiguredChannelPluginBlockers(
5058 env,
5159includeDisabled: true,
5260});
61+const activeConfiguredChannelIds = new Set(
62+resolveConfiguredChannelPresencePolicy({
63+config: cfg,
64+ env,
65+includePersistedAuthState: false,
66+manifestRecords: registry.plugins,
67+})
68+.filter((entry) => entry.effective)
69+.map((entry) => entry.channelId),
70+);
5371const hits: ChannelPluginBlockerHit[] = [];
54725573for (const plugin of registry.plugins) {
@@ -73,10 +91,17 @@ export function scanConfiguredChannelPluginBlockers(
7391continue;
7492}
759376-for (const channelId of plugin.channels) {
94+for (const rawChannelId of plugin.channels) {
95+const channelId = normalizeOptionalLowercaseString(rawChannelId);
96+if (!channelId) {
97+continue;
98+}
7799if (!configuredChannelIds.has(channelId)) {
78100continue;
79101}
102+if (activeConfiguredChannelIds.has(channelId)) {
103+continue;
104+}
80105hits.push({
81106 channelId,
82107pluginId: plugin.id,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。