




















@@ -11,6 +11,7 @@ import {
1111import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js";
1212import { normalizePluginsConfig } from "../plugins/config-state.js";
1313import { getCurrentPluginMetadataSnapshot } from "../plugins/current-plugin-metadata-snapshot.js";
14+import type { PluginDiscoveryResult } from "../plugins/discovery.js";
1415import { resolveInstalledPluginIndexPolicyHash } from "../plugins/installed-plugin-index-policy.js";
1516import {
1617type PluginManifestRecord,
@@ -265,10 +266,15 @@ function collectPluginIdsForConfiguredChannel(
265266return [claims[0]?.plugin.id ?? builtInId ?? normalizedChannelId];
266267}
267268268-function collectConfiguredChannelIds(cfg: OpenClawConfig, env: NodeJS.ProcessEnv): string[] {
269-const configuredStateChannelIds = new Set(listBundledChannelIdsWithConfiguredState());
269+function collectConfiguredChannelIds(
270+cfg: OpenClawConfig,
271+env: NodeJS.ProcessEnv,
272+discovery?: PluginDiscoveryResult,
273+): string[] {
274+const configuredStateChannelIds = new Set(listBundledChannelIdsWithConfiguredState(discovery));
270275return listPotentialConfiguredChannelPresenceSignals(cfg, env, {
271276includePersistedAuthState: false,
277+ discovery,
272278})
273279.map((signal) => ({
274280source: signal.source,
@@ -281,6 +287,7 @@ function collectConfiguredChannelIds(cfg: OpenClawConfig, env: NodeJS.ProcessEnv
281287 channelId,
282288 source,
283289 configuredStateChannelIds,
290+ discovery,
284291}),
285292)
286293.map(({ channelId }) => channelId);
@@ -292,6 +299,7 @@ function isAutoEnableConfiguredChannelSignal(params: {
292299channelId: string;
293300source: ChannelPresenceSignalSource;
294301configuredStateChannelIds: ReadonlySet<string>;
302+discovery?: PluginDiscoveryResult;
295303}): boolean {
296304if (
297305params.source === "env" &&
@@ -300,6 +308,7 @@ function isAutoEnableConfiguredChannelSignal(params: {
300308channelId: params.channelId,
301309cfg: params.cfg,
302310env: params.env,
311+discovery: params.discovery,
303312})
304313) {
305314return false;
@@ -535,6 +544,7 @@ export function configMayNeedPluginAutoEnable(
535544export function resolvePluginAutoEnableReadiness(
536545cfg: OpenClawConfig,
537546env: NodeJS.ProcessEnv,
547+discovery?: PluginDiscoveryResult,
538548): { mayNeedAutoEnable: boolean; configuredChannelIds: string[] } {
539549if (arePluginsGloballyDisabled(cfg)) {
540550return { mayNeedAutoEnable: false, configuredChannelIds: [] };
@@ -545,7 +555,7 @@ export function resolvePluginAutoEnableReadiness(
545555if (hasConfiguredPluginConfigEntry(cfg)) {
546556return { mayNeedAutoEnable: true, configuredChannelIds: [] };
547557}
548-const configuredChannelIds = collectConfiguredChannelIds(cfg, env);
558+const configuredChannelIds = collectConfiguredChannelIds(cfg, env, discovery);
549559if (configuredChannelIds.length > 0) {
550560return { mayNeedAutoEnable: true, configuredChannelIds };
551561}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。