Skip to content

Commit 1c6786e

Browse files
committed
fix(onboarding): scope post-config runtime deps
1 parent cba0a34 commit 1c6786e

6 files changed

Lines changed: 55 additions & 10 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Docs: https://docs.openclaw.ai
2323
### Fixes
2424

2525
- fix(infra): block ambient Homebrew env vars from brew resolution. (#74463) Thanks @pgondhi987.
26+
- 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.
2627
- 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.
2728
- 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.
2829
- Plugins/TTS: keep bundled speech-provider discovery available on cold package Gateway paths and add bundled plugin matrix runtime probes for health, readiness, RPC, TTS discovery, and post-ready runtime-deps watchdog coverage. Refs #75283. Thanks @vincentkoc.

src/commands/post-config-runtime-deps.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ describe("preparePostConfigBundledRuntimeDeps", () => {
9595
packageRoot: "/pkg",
9696
config,
9797
includeConfiguredChannels: true,
98+
includeEnabledByDefaultPlugins: false,
9899
env,
99100
});
100101
expect(mocks.repairBundledRuntimeDepsPackagePlanAsync).toHaveBeenCalledWith(
101102
expect.objectContaining({
102103
packageRoot: "/pkg",
103104
config,
104105
includeConfiguredChannels: true,
106+
includeEnabledByDefaultPlugins: false,
105107
env,
106108
}),
107109
);

src/commands/post-config-runtime-deps.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export async function preparePostConfigBundledRuntimeDeps(params: {
6666
packageRoot,
6767
config: params.config,
6868
includeConfiguredChannels: true,
69+
includeEnabledByDefaultPlugins: false,
6970
env,
7071
});
7172
if (plan.conflicts.length > 0) {
@@ -102,6 +103,7 @@ export async function preparePostConfigBundledRuntimeDeps(params: {
102103
packageRoot,
103104
config: params.config,
104105
includeConfiguredChannels: true,
106+
includeEnabledByDefaultPlugins: false,
105107
env,
106108
...(params.installDeps
107109
? {

src/plugins/bundled-runtime-deps-selection.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ export function isBundledPluginConfiguredForRuntimeDeps(params: {
482482
pluginDir: string;
483483
configuredModelOwnerPluginIds?: ReadonlySet<string>;
484484
includeConfiguredChannels?: boolean;
485+
includeEnabledByDefaultPlugins?: boolean;
485486
manifestCache?: BundledPluginRuntimeDepsManifestCache;
486487
}): boolean {
487488
if (
@@ -560,7 +561,11 @@ export function isBundledPluginConfiguredForRuntimeDeps(params: {
560561
) {
561562
return true;
562563
}
563-
return manifest.enabledByDefault && manifest.providers.length === 0;
564+
return (
565+
(params.includeEnabledByDefaultPlugins ?? true) &&
566+
manifest.enabledByDefault &&
567+
manifest.providers.length === 0
568+
);
564569
}
565570

566571
function isBundledPluginExplicitlyDisabledForRuntimeDeps(params: {
@@ -600,6 +605,7 @@ function shouldIncludeBundledPluginRuntimeDeps(params: {
600605
pluginDir: string;
601606
configuredModelOwnerPluginIds?: ReadonlySet<string>;
602607
includeConfiguredChannels?: boolean;
608+
includeEnabledByDefaultPlugins?: boolean;
603609
manifestCache?: BundledPluginRuntimeDepsManifestCache;
604610
}): boolean {
605611
if (params.exactPluginIds) {
@@ -650,6 +656,7 @@ function shouldIncludeBundledPluginRuntimeDeps(params: {
650656
pluginDir: params.pluginDir,
651657
configuredModelOwnerPluginIds: params.configuredModelOwnerPluginIds,
652658
includeConfiguredChannels: params.includeConfiguredChannels,
659+
includeEnabledByDefaultPlugins: params.includeEnabledByDefaultPlugins,
653660
manifestCache: params.manifestCache,
654661
});
655662
}
@@ -660,6 +667,7 @@ export function collectBundledPluginRuntimeDeps(params: {
660667
pluginIds?: ReadonlySet<string>;
661668
exactPluginIds?: ReadonlySet<string>;
662669
includeConfiguredChannels?: boolean;
670+
includeEnabledByDefaultPlugins?: boolean;
663671
manifestCache?: BundledPluginRuntimeDepsManifestCache;
664672
normalizePluginId?: NormalizePluginId;
665673
}): {
@@ -707,6 +715,7 @@ export function collectBundledPluginRuntimeDeps(params: {
707715
pluginDir,
708716
configuredModelOwnerPluginIds,
709717
includeConfiguredChannels: params.includeConfiguredChannels,
718+
includeEnabledByDefaultPlugins: params.includeEnabledByDefaultPlugins,
710719
manifestCache,
711720
})
712721
) {

src/plugins/bundled-runtime-deps.test.ts

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,7 @@ describe("createBundledRuntimeDepsPackagePlan config policy", () => {
11451145
name: string;
11461146
config: Parameters<typeof createBundledRuntimeDepsPackagePlan>[0]["config"];
11471147
includeConfiguredChannels: boolean;
1148+
includeEnabledByDefaultPlugins?: boolean;
11481149
expectedDeps: string[];
11491150
};
11501151

@@ -1329,18 +1330,43 @@ describe("createBundledRuntimeDepsPackagePlan config policy", () => {
13291330
includeConfiguredChannels: false,
13301331
expectedDeps: ["[email protected]"],
13311332
},
1333+
{
1334+
name: "can omit default-enabled bundled plugins for post-config repair",
1335+
config: {},
1336+
includeConfiguredChannels: true,
1337+
includeEnabledByDefaultPlugins: false,
1338+
expectedDeps: [],
1339+
},
1340+
{
1341+
name: "includes configured channels when default-enabled plugins are omitted",
1342+
config: { channels: { telegram: { botToken: "123:abc" } } },
1343+
includeConfiguredChannels: true,
1344+
includeEnabledByDefaultPlugins: false,
1345+
expectedDeps: ["[email protected]"],
1346+
},
1347+
{
1348+
name: "includes configured provider deps when default-enabled plugins are omitted",
1349+
config: { agents: { defaults: { model: "amazon-bedrock/claude-opus-4-7" } } },
1350+
includeConfiguredChannels: false,
1351+
includeEnabledByDefaultPlugins: false,
1352+
expectedDeps: ["[email protected]"],
1353+
},
13321354
];
13331355

1334-
it.each(cases)("$name", ({ config, includeConfiguredChannels, expectedDeps }) => {
1335-
const result = createBundledRuntimeDepsPackagePlan({
1336-
packageRoot: setupPolicyPackageRoot(),
1337-
config,
1338-
includeConfiguredChannels,
1339-
});
1356+
it.each(cases)(
1357+
"$name",
1358+
({ config, includeConfiguredChannels, includeEnabledByDefaultPlugins, expectedDeps }) => {
1359+
const result = createBundledRuntimeDepsPackagePlan({
1360+
packageRoot: setupPolicyPackageRoot(),
1361+
config,
1362+
includeConfiguredChannels,
1363+
...(includeEnabledByDefaultPlugins !== undefined ? { includeEnabledByDefaultPlugins } : {}),
1364+
});
13401365

1341-
expect(result.deps.map((dep) => `${dep.name}@${dep.version}`)).toEqual(expectedDeps);
1342-
expect(result.conflicts).toEqual([]);
1343-
});
1366+
expect(result.deps.map((dep) => `${dep.name}@${dep.version}`)).toEqual(expectedDeps);
1367+
expect(result.conflicts).toEqual([]);
1368+
},
1369+
);
13441370

13451371
it("honors deny and disabled entries when scanning an explicit effective plugin set", () => {
13461372
const packageRoot = setupPolicyPackageRoot();

src/plugins/bundled-runtime-deps.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export type BundledRuntimeDepsPackagePlanParams = {
9292
pluginIds?: readonly string[];
9393
exactPluginIds?: readonly string[];
9494
includeConfiguredChannels?: boolean;
95+
includeEnabledByDefaultPlugins?: boolean;
9596
env?: NodeJS.ProcessEnv;
9697
};
9798

@@ -367,6 +368,9 @@ export function createBundledRuntimeDepsPackagePlan(
367368
...(!exactPluginIds && params.includeConfiguredChannels !== undefined
368369
? { includeConfiguredChannels: params.includeConfiguredChannels }
369370
: {}),
371+
...(!exactPluginIds && params.includeEnabledByDefaultPlugins !== undefined
372+
? { includeEnabledByDefaultPlugins: params.includeEnabledByDefaultPlugins }
373+
: {}),
370374
manifestCache,
371375
...(normalizePluginId ? { normalizePluginId } : {}),
372376
});
@@ -394,6 +398,7 @@ export async function repairBundledRuntimeDepsPackagePlanAsync(params: {
394398
pluginIds?: readonly string[];
395399
exactPluginIds?: readonly string[];
396400
includeConfiguredChannels?: boolean;
401+
includeEnabledByDefaultPlugins?: boolean;
397402
env: NodeJS.ProcessEnv;
398403
installDeps?: (params: BundledRuntimeDepsInstallParams) => Promise<void> | void;
399404
onProgress?: (message: string) => void;

0 commit comments

Comments
 (0)