






















@@ -482,38 +482,48 @@ export function configMayNeedPluginAutoEnable(
482482cfg: OpenClawConfig,
483483env: NodeJS.ProcessEnv,
484484): boolean {
485+return resolvePluginAutoEnableReadiness(cfg, env).mayNeedAutoEnable;
486+}
487+488+export function resolvePluginAutoEnableReadiness(
489+cfg: OpenClawConfig,
490+env: NodeJS.ProcessEnv,
491+): { mayNeedAutoEnable: boolean; configuredChannelIds: string[] } {
485492if (arePluginsGloballyDisabled(cfg)) {
486-return false;
493+return { mayNeedAutoEnable: false, configuredChannelIds: [] };
487494}
488495if (hasPluginAllowlistWithMaterialEntries(cfg)) {
489-return true;
496+return { mayNeedAutoEnable: true, configuredChannelIds: [] };
490497}
491498if (hasConfiguredPluginConfigEntry(cfg)) {
492-return true;
499+return { mayNeedAutoEnable: true, configuredChannelIds: [] };
493500}
494-if (collectConfiguredChannelIds(cfg, env).length > 0) {
495-return true;
501+const configuredChannelIds = collectConfiguredChannelIds(cfg, env);
502+if (configuredChannelIds.length > 0) {
503+return { mayNeedAutoEnable: true, configuredChannelIds };
496504}
497505if (hasConfiguredProviderModelOrHarness(cfg, env)) {
498-return true;
506+return { mayNeedAutoEnable: true, configuredChannelIds };
499507}
500508if (
501509hasConfiguredWebSearchProviderSelection(cfg) ||
502510hasConfiguredWebSearchPluginEntry(cfg) ||
503511hasConfiguredWebFetchPluginEntry(cfg)
504512) {
505-return true;
513+return { mayNeedAutoEnable: true, configuredChannelIds };
506514}
507515if (!hasSetupAutoEnableRelevantConfig(cfg)) {
508-return false;
516+return { mayNeedAutoEnable: false, configuredChannelIds };
509517}
510-return (
511-resolvePluginSetupAutoEnableReasons({
512-config: cfg,
513- env,
514-pluginIds: resolveRelevantSetupAutoEnablePluginIds(cfg),
515-}).length > 0
516-);
518+return {
519+mayNeedAutoEnable:
520+resolvePluginSetupAutoEnableReasons({
521+config: cfg,
522+ env,
523+pluginIds: resolveRelevantSetupAutoEnablePluginIds(cfg),
524+}).length > 0,
525+ configuredChannelIds,
526+};
517527}
518528519529export function resolvePluginAutoEnableCandidateReason(
@@ -548,9 +558,11 @@ export function resolveConfiguredPluginAutoEnableCandidates(params: {
548558config: OpenClawConfig;
549559env: NodeJS.ProcessEnv;
550560registry: PluginManifestRegistry;
561+configuredChannelIds?: readonly string[];
551562}): PluginAutoEnableCandidate[] {
552563const changes: PluginAutoEnableCandidate[] = [];
553-for (const channelId of collectConfiguredChannelIds(params.config, params.env)) {
564+for (const channelId of params.configuredChannelIds ??
565+collectConfiguredChannelIds(params.config, params.env)) {
554566for (const pluginId of collectPluginIdsForConfiguredChannel(channelId, params.registry)) {
555567changes.push({ pluginId, kind: "channel-configured", channelId });
556568}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。