diff --git a/src/config/plugin-auto-enable.apply.ts b/src/config/plugin-auto-enable.apply.ts index be59ed82357..4de04385fc8 100644 --- a/src/config/plugin-auto-enable.apply.ts +++ b/src/config/plugin-auto-enable.apply.ts @@ -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, diff --git a/src/config/plugin-auto-enable.shared.ts b/src/config/plugin-auto-enable.shared.ts index 71148a45186..41dd7ea5910 100644 --- a/src/config/plugin-auto-enable.shared.ts +++ b/src/config/plugin-auto-enable.shared.ts @@ -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)) {