mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:30:43 +00:00
perf: avoid no-op plugin auto-enable scans
This commit is contained in:
@@ -18,6 +18,15 @@ export function materializePluginAutoEnableCandidates(params: {
|
||||
}): PluginAutoEnableResult {
|
||||
const env = params.env ?? process.env;
|
||||
const config = params.config ?? {};
|
||||
const entries = config.plugins?.entries;
|
||||
const hasRestrictiveAllowlistWithEntries =
|
||||
Array.isArray(config.plugins?.allow) &&
|
||||
config.plugins.allow.length > 0 &&
|
||||
entries !== undefined &&
|
||||
typeof entries === "object";
|
||||
if (params.candidates.length === 0 && !hasRestrictiveAllowlistWithEntries) {
|
||||
return { config, changes: [], autoEnabledReasons: {} };
|
||||
}
|
||||
const manifestRegistry = resolvePluginAutoEnableManifestRegistry({
|
||||
config,
|
||||
env,
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { collectConfiguredAgentHarnessRuntimes } from "../agents/harness-runtimes.js";
|
||||
import { normalizeProviderId } from "../agents/provider-id.js";
|
||||
import {
|
||||
hasPotentialConfiguredChannels,
|
||||
listPotentialConfiguredChannelPresenceSignals,
|
||||
} from "../channels/config-presence.js";
|
||||
import { listPotentialConfiguredChannelPresenceSignals } from "../channels/config-presence.js";
|
||||
import { getChatChannelMeta, normalizeChatChannelId } from "../channels/registry.js";
|
||||
import {
|
||||
type PluginManifestRecord,
|
||||
@@ -493,7 +490,7 @@ export function configMayNeedPluginAutoEnable(
|
||||
if (hasConfiguredPluginConfigEntry(cfg)) {
|
||||
return true;
|
||||
}
|
||||
if (hasPotentialConfiguredChannels(cfg, env, { includePersistedAuthState: false })) {
|
||||
if (collectConfiguredChannelIds(cfg, env).length > 0) {
|
||||
return true;
|
||||
}
|
||||
if (hasConfiguredProviderModelOrHarness(cfg, env)) {
|
||||
|
||||
Reference in New Issue
Block a user