perf: avoid no-op plugin auto-enable scans · openclaw/openclaw@1672d35
steipete
·
2026-05-06
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,6 +18,15 @@ export function materializePluginAutoEnableCandidates(params: {
|
18 | 18 | }): PluginAutoEnableResult { |
19 | 19 | const env = params.env ?? process.env; |
20 | 20 | const config = params.config ?? {}; |
| 21 | +const entries = config.plugins?.entries; |
| 22 | +const hasRestrictiveAllowlistWithEntries = |
| 23 | +Array.isArray(config.plugins?.allow) && |
| 24 | +config.plugins.allow.length > 0 && |
| 25 | +entries !== undefined && |
| 26 | +typeof entries === "object"; |
| 27 | +if (params.candidates.length === 0 && !hasRestrictiveAllowlistWithEntries) { |
| 28 | +return { config, changes: [], autoEnabledReasons: {} }; |
| 29 | +} |
21 | 30 | const manifestRegistry = resolvePluginAutoEnableManifestRegistry({ |
22 | 31 | config, |
23 | 32 | env, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { collectConfiguredAgentHarnessRuntimes } from "../agents/harness-runtimes.js"; |
2 | 2 | import { normalizeProviderId } from "../agents/provider-id.js"; |
3 | | -import { |
4 | | -hasPotentialConfiguredChannels, |
5 | | -listPotentialConfiguredChannelPresenceSignals, |
6 | | -} from "../channels/config-presence.js"; |
| 3 | +import { listPotentialConfiguredChannelPresenceSignals } from "../channels/config-presence.js"; |
7 | 4 | import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js"; |
8 | 5 | import { |
9 | 6 | type PluginManifestRecord, |
@@ -493,7 +490,7 @@ export function configMayNeedPluginAutoEnable(
|
493 | 490 | if (hasConfiguredPluginConfigEntry(cfg)) { |
494 | 491 | return true; |
495 | 492 | } |
496 | | -if (hasPotentialConfiguredChannels(cfg, env, { includePersistedAuthState: false })) { |
| 493 | +if (collectConfiguredChannelIds(cfg, env).length > 0) { |
497 | 494 | return true; |
498 | 495 | } |
499 | 496 | if (hasConfiguredProviderModelOrHarness(cfg, env)) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。