fix: keep runtime deps repair out of hot paths

This commit is contained in:
Peter Steinberger
2026-05-01 09:25:26 +01:00
parent e131eaecb5
commit 29ed5266bf
13 changed files with 31 additions and 13 deletions

View File

@@ -103,6 +103,7 @@ function expectBundledCompatLoadPath(params: {
config: params.enablementCompat,
onlyPluginIds: ["openai"],
activate: false,
installBundledRuntimeDeps: false,
});
}
@@ -408,6 +409,7 @@ describe("resolvePluginCapabilityProviders", () => {
}),
onlyPluginIds: ["microsoft"],
activate: false,
installBundledRuntimeDeps: false,
});
});
@@ -616,6 +618,7 @@ describe("resolvePluginCapabilityProviders", () => {
config: expect.anything(),
onlyPluginIds: [],
activate: false,
installBundledRuntimeDeps: false,
});
});
@@ -660,6 +663,7 @@ describe("resolvePluginCapabilityProviders", () => {
config: compatConfig,
onlyPluginIds: ["google"],
activate: false,
installBundledRuntimeDeps: false,
});
});
@@ -795,6 +799,7 @@ describe("resolvePluginCapabilityProviders", () => {
config: compatConfig,
onlyPluginIds: ["microsoft"],
activate: false,
installBundledRuntimeDeps: false,
});
});
@@ -818,6 +823,7 @@ describe("resolvePluginCapabilityProviders", () => {
config: expect.anything(),
onlyPluginIds: [],
activate: false,
installBundledRuntimeDeps: false,
});
});
@@ -955,6 +961,7 @@ describe("resolvePluginCapabilityProviders", () => {
config: enablementCompat,
onlyPluginIds: ["google"],
activate: false,
installBundledRuntimeDeps: false,
});
});
@@ -1077,6 +1084,7 @@ describe("resolvePluginCapabilityProviders", () => {
config: enablementCompat,
onlyPluginIds: ["microsoft"],
activate: false,
installBundledRuntimeDeps: false,
});
});
});

View File

@@ -315,7 +315,7 @@ export function resolvePluginCapabilityProvider<K extends CapabilityProviderRegi
const loadOptions = createCapabilityProviderFallbackLoadOptions({
compatConfig,
pluginIds,
installBundledRuntimeDeps: params.installBundledRuntimeDeps,
installBundledRuntimeDeps: params.installBundledRuntimeDeps ?? false,
});
const cache = resolveCapabilityProviderSnapshotCache(params.cfg);
const cacheKey = cache
@@ -373,7 +373,7 @@ export function resolvePluginCapabilityProviders<K extends CapabilityProviderReg
const loadOptions = createCapabilityProviderFallbackLoadOptions({
compatConfig,
pluginIds,
installBundledRuntimeDeps: params.installBundledRuntimeDeps,
installBundledRuntimeDeps: params.installBundledRuntimeDeps ?? false,
});
const cache = resolveCapabilityProviderSnapshotCache(params.cfg);
const cacheKey = cache

View File

@@ -261,7 +261,7 @@ function resolveRuntimeProviderPluginLoadState(
pluginSdkResolution: params.pluginSdkResolution,
cache: params.cache ?? true,
activate: params.activate ?? false,
installBundledRuntimeDeps: params.installBundledRuntimeDeps,
installBundledRuntimeDeps: params.installBundledRuntimeDeps ?? false,
},
);
return { loadOptions };

View File

@@ -162,6 +162,7 @@ describe("ensurePluginRegistryLoaded", () => {
workspaceDir: "/resolved-workspace",
onlyPluginIds: ["demo-channel"],
throwOnLoadError: true,
installBundledRuntimeDeps: false,
}),
);
});

View File

@@ -175,7 +175,7 @@ export function ensurePluginRegistryLoaded(options?: {
},
{
throwOnLoadError: true,
installBundledRuntimeDeps: options?.installBundledRuntimeDeps,
installBundledRuntimeDeps: options?.installBundledRuntimeDeps ?? false,
...(hasExplicitPluginIdScope(requestedPluginIds) ||
shouldForwardChannelScope({ scope, scopedLoad }) ||
hasNonEmptyPluginIdScope(expectedChannelPluginIds)

View File

@@ -457,6 +457,7 @@ describe("resolvePluginTools optional tools", () => {
expect(loadOpenClawPluginsMock).toHaveBeenCalledWith(
expect.objectContaining({
installBundledRuntimeDeps: false,
runtimeOptions: {
allowGatewaySubagentBinding: true,
},

View File

@@ -133,7 +133,10 @@ export function resolvePluginTools(params: {
const runtimeOptions = params.allowGatewaySubagentBinding
? { allowGatewaySubagentBinding: true as const }
: undefined;
const loadOptions = buildPluginRuntimeLoadOptions(context, { runtimeOptions });
const loadOptions = buildPluginRuntimeLoadOptions(context, {
installBundledRuntimeDeps: false,
runtimeOptions,
});
const registry = resolvePluginToolRegistry({
loadOptions,
allowGatewaySubagentBinding: params.allowGatewaySubagentBinding,