diff --git a/src/plugins/loader.ts b/src/plugins/loader.ts index c36c84eeca9..1c9e3625203 100644 --- a/src/plugins/loader.ts +++ b/src/plugins/loader.ts @@ -758,6 +758,14 @@ function hasExplicitCompatibilityInputs(options: PluginLoadOptions): boolean { ); } +function resolveCoreGatewayMethodNames(options: PluginLoadOptions): string[] { + const names = new Set(options.coreGatewayMethodNames ?? []); + for (const name of Object.keys(options.coreGatewayHandlers ?? {})) { + names.add(name); + } + return Array.from(names).toSorted(); +} + function pluginLoadOptionsMatchCacheKey( options: PluginLoadOptions, expectedCacheKey: string, @@ -890,12 +898,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) { const preferSetupRuntimeForChannelPlugins = options.preferSetupRuntimeForChannelPlugins === true; const shouldInstallBundledRuntimeDeps = options.installBundledRuntimeDeps !== false; const runtimeSubagentMode = resolveRuntimeSubagentMode(options.runtimeOptions); - const coreGatewayMethodNames = Array.from( - new Set([ - ...(options.coreGatewayMethodNames ?? []), - ...Object.keys(options.coreGatewayHandlers ?? {}), - ]), - ).toSorted(); + const coreGatewayMethodNames = resolveCoreGatewayMethodNames(options); const installRecords = { ...loadInstalledPluginIndexInstallRecordsSync({ env }), ...cfg.plugins?.installs,