From 1e66728a55490a41c0db29bf4c26589dcf54367c Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 1 May 2026 06:20:50 -0700 Subject: [PATCH] fix(onboarding): scope post-config runtime deps (#75653) --- CHANGELOG.md | 1 + src/commands/post-config-runtime-deps.test.ts | 2 + src/commands/post-config-runtime-deps.ts | 2 + src/plugins/bundled-runtime-deps-selection.ts | 11 ++++- src/plugins/bundled-runtime-deps.test.ts | 44 +++++++++++++++---- src/plugins/bundled-runtime-deps.ts | 5 +++ 6 files changed, 55 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fba66bd6de..d0ec3c18a0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Docs: https://docs.openclaw.ai - fix: block workspace CLOUDSDK_PYTHON override and always set trusted interpreter for gcloud. (#74492) Thanks @pgondhi987. - Providers/Z.AI: move the bundled GLM catalog and auth env metadata into the plugin manifest, so `models list --all --provider zai` shows the full known catalog without duplicated runtime seed data. Thanks @shakkernerd. - fix(infra): block ambient Homebrew env vars from brew resolution. (#74463) Thanks @pgondhi987. +- Onboarding/configure: avoid staging every default plugin runtime dependency after config writes, so skipped setup flows only prepare config-selected plugin deps instead of pulling broad feature-plugin packages. Thanks @vincentkoc. - Thinking/providers: resolve bundled provider thinking profiles through lightweight provider policy artifacts when startup-lazy providers are not active, so OpenAI Codex GPT-5.x keeps xhigh available in Gateway session validation. Fixes #74796. Thanks @maxschachere. - Security/Windows: ignore workspace `.env` system-path variables and resolve stale-process `taskkill.exe` from the validated Windows install root, preventing repository-local env files from redirecting cleanup helpers. Thanks @pgondhi987. - CLI/plugins: scope install and enable slot selection to the selected plugin manifest/runtime fallback, so plugin installs no longer load every plugin runtime or broad status snapshot just to update memory/context slots. Thanks @vincentkoc. diff --git a/src/commands/post-config-runtime-deps.test.ts b/src/commands/post-config-runtime-deps.test.ts index 7f63914281f..dcaa4919827 100644 --- a/src/commands/post-config-runtime-deps.test.ts +++ b/src/commands/post-config-runtime-deps.test.ts @@ -95,6 +95,7 @@ describe("preparePostConfigBundledRuntimeDeps", () => { packageRoot: "/pkg", config, includeConfiguredChannels: true, + includeEnabledByDefaultPlugins: false, env, }); expect(mocks.repairBundledRuntimeDepsPackagePlanAsync).toHaveBeenCalledWith( @@ -102,6 +103,7 @@ describe("preparePostConfigBundledRuntimeDeps", () => { packageRoot: "/pkg", config, includeConfiguredChannels: true, + includeEnabledByDefaultPlugins: false, env, }), ); diff --git a/src/commands/post-config-runtime-deps.ts b/src/commands/post-config-runtime-deps.ts index f0922cf23fd..9cfe0980cdc 100644 --- a/src/commands/post-config-runtime-deps.ts +++ b/src/commands/post-config-runtime-deps.ts @@ -66,6 +66,7 @@ export async function preparePostConfigBundledRuntimeDeps(params: { packageRoot, config: params.config, includeConfiguredChannels: true, + includeEnabledByDefaultPlugins: false, env, }); if (plan.conflicts.length > 0) { @@ -102,6 +103,7 @@ export async function preparePostConfigBundledRuntimeDeps(params: { packageRoot, config: params.config, includeConfiguredChannels: true, + includeEnabledByDefaultPlugins: false, env, ...(params.installDeps ? { diff --git a/src/plugins/bundled-runtime-deps-selection.ts b/src/plugins/bundled-runtime-deps-selection.ts index 297676eff0c..f8f8f1146ac 100644 --- a/src/plugins/bundled-runtime-deps-selection.ts +++ b/src/plugins/bundled-runtime-deps-selection.ts @@ -482,6 +482,7 @@ export function isBundledPluginConfiguredForRuntimeDeps(params: { pluginDir: string; configuredModelOwnerPluginIds?: ReadonlySet; includeConfiguredChannels?: boolean; + includeEnabledByDefaultPlugins?: boolean; manifestCache?: BundledPluginRuntimeDepsManifestCache; }): boolean { if ( @@ -560,7 +561,11 @@ export function isBundledPluginConfiguredForRuntimeDeps(params: { ) { return true; } - return manifest.enabledByDefault && manifest.providers.length === 0; + return ( + (params.includeEnabledByDefaultPlugins ?? true) && + manifest.enabledByDefault && + manifest.providers.length === 0 + ); } function isBundledPluginExplicitlyDisabledForRuntimeDeps(params: { @@ -600,6 +605,7 @@ function shouldIncludeBundledPluginRuntimeDeps(params: { pluginDir: string; configuredModelOwnerPluginIds?: ReadonlySet; includeConfiguredChannels?: boolean; + includeEnabledByDefaultPlugins?: boolean; manifestCache?: BundledPluginRuntimeDepsManifestCache; }): boolean { if (params.exactPluginIds) { @@ -650,6 +656,7 @@ function shouldIncludeBundledPluginRuntimeDeps(params: { pluginDir: params.pluginDir, configuredModelOwnerPluginIds: params.configuredModelOwnerPluginIds, includeConfiguredChannels: params.includeConfiguredChannels, + includeEnabledByDefaultPlugins: params.includeEnabledByDefaultPlugins, manifestCache: params.manifestCache, }); } @@ -660,6 +667,7 @@ export function collectBundledPluginRuntimeDeps(params: { pluginIds?: ReadonlySet; exactPluginIds?: ReadonlySet; includeConfiguredChannels?: boolean; + includeEnabledByDefaultPlugins?: boolean; manifestCache?: BundledPluginRuntimeDepsManifestCache; normalizePluginId?: NormalizePluginId; }): { @@ -707,6 +715,7 @@ export function collectBundledPluginRuntimeDeps(params: { pluginDir, configuredModelOwnerPluginIds, includeConfiguredChannels: params.includeConfiguredChannels, + includeEnabledByDefaultPlugins: params.includeEnabledByDefaultPlugins, manifestCache, }) ) { diff --git a/src/plugins/bundled-runtime-deps.test.ts b/src/plugins/bundled-runtime-deps.test.ts index 7ff759836b4..f5997621d3b 100644 --- a/src/plugins/bundled-runtime-deps.test.ts +++ b/src/plugins/bundled-runtime-deps.test.ts @@ -1145,6 +1145,7 @@ describe("createBundledRuntimeDepsPackagePlan config policy", () => { name: string; config: Parameters[0]["config"]; includeConfiguredChannels: boolean; + includeEnabledByDefaultPlugins?: boolean; expectedDeps: string[]; }; @@ -1329,18 +1330,43 @@ describe("createBundledRuntimeDepsPackagePlan config policy", () => { includeConfiguredChannels: false, expectedDeps: ["alpha-runtime@1.0.0"], }, + { + name: "can omit default-enabled bundled plugins for post-config repair", + config: {}, + includeConfiguredChannels: true, + includeEnabledByDefaultPlugins: false, + expectedDeps: [], + }, + { + name: "includes configured channels when default-enabled plugins are omitted", + config: { channels: { telegram: { botToken: "123:abc" } } }, + includeConfiguredChannels: true, + includeEnabledByDefaultPlugins: false, + expectedDeps: ["telegram-runtime@2.0.0"], + }, + { + name: "includes configured provider deps when default-enabled plugins are omitted", + config: { agents: { defaults: { model: "amazon-bedrock/claude-opus-4-7" } } }, + includeConfiguredChannels: false, + includeEnabledByDefaultPlugins: false, + expectedDeps: ["bedrock-runtime@3.0.0"], + }, ]; - it.each(cases)("$name", ({ config, includeConfiguredChannels, expectedDeps }) => { - const result = createBundledRuntimeDepsPackagePlan({ - packageRoot: setupPolicyPackageRoot(), - config, - includeConfiguredChannels, - }); + it.each(cases)( + "$name", + ({ config, includeConfiguredChannels, includeEnabledByDefaultPlugins, expectedDeps }) => { + const result = createBundledRuntimeDepsPackagePlan({ + packageRoot: setupPolicyPackageRoot(), + config, + includeConfiguredChannels, + ...(includeEnabledByDefaultPlugins !== undefined ? { includeEnabledByDefaultPlugins } : {}), + }); - expect(result.deps.map((dep) => `${dep.name}@${dep.version}`)).toEqual(expectedDeps); - expect(result.conflicts).toEqual([]); - }); + expect(result.deps.map((dep) => `${dep.name}@${dep.version}`)).toEqual(expectedDeps); + expect(result.conflicts).toEqual([]); + }, + ); it("honors deny and disabled entries when scanning an explicit effective plugin set", () => { const packageRoot = setupPolicyPackageRoot(); diff --git a/src/plugins/bundled-runtime-deps.ts b/src/plugins/bundled-runtime-deps.ts index a9da526fdcf..e6272e2153d 100644 --- a/src/plugins/bundled-runtime-deps.ts +++ b/src/plugins/bundled-runtime-deps.ts @@ -92,6 +92,7 @@ export type BundledRuntimeDepsPackagePlanParams = { pluginIds?: readonly string[]; exactPluginIds?: readonly string[]; includeConfiguredChannels?: boolean; + includeEnabledByDefaultPlugins?: boolean; env?: NodeJS.ProcessEnv; }; @@ -367,6 +368,9 @@ export function createBundledRuntimeDepsPackagePlan( ...(!exactPluginIds && params.includeConfiguredChannels !== undefined ? { includeConfiguredChannels: params.includeConfiguredChannels } : {}), + ...(!exactPluginIds && params.includeEnabledByDefaultPlugins !== undefined + ? { includeEnabledByDefaultPlugins: params.includeEnabledByDefaultPlugins } + : {}), manifestCache, ...(normalizePluginId ? { normalizePluginId } : {}), }); @@ -394,6 +398,7 @@ export async function repairBundledRuntimeDepsPackagePlanAsync(params: { pluginIds?: readonly string[]; exactPluginIds?: readonly string[]; includeConfiguredChannels?: boolean; + includeEnabledByDefaultPlugins?: boolean; env: NodeJS.ProcessEnv; installDeps?: (params: BundledRuntimeDepsInstallParams) => Promise | void; onProgress?: (message: string) => void;