






















@@ -145,6 +145,7 @@ export type PluginLoadOptions = {
145145preferSetupRuntimeForChannelPlugins?: boolean;
146146activate?: boolean;
147147loadModules?: boolean;
148+installBundledRuntimeDeps?: boolean;
148149throwOnLoadError?: boolean;
149150bundledRuntimeDepsInstaller?: (params: BundledRuntimeDepsInstallParams) => void;
150151};
@@ -780,6 +781,7 @@ function buildCacheKey(params: {
780781requireSetupEntryForSetupOnlyChannelPlugins?: boolean;
781782preferSetupRuntimeForChannelPlugins?: boolean;
782783loadModules?: boolean;
784+installBundledRuntimeDeps?: boolean;
783785runtimeSubagentMode?: "default" | "explicit" | "gateway-bindable";
784786pluginSdkResolution?: PluginSdkResolutionPreference;
785787coreGatewayMethodNames?: string[];
@@ -816,14 +818,16 @@ function buildCacheKey(params: {
816818const startupChannelMode =
817819params.preferSetupRuntimeForChannelPlugins === true ? "prefer-setup" : "full";
818820const moduleLoadMode = params.loadModules === false ? "manifest-only" : "load-modules";
821+const bundledRuntimeDepsMode =
822+params.installBundledRuntimeDeps === false ? "skip-runtime-deps" : "install-runtime-deps";
819823const runtimeSubagentMode = params.runtimeSubagentMode ?? "default";
820824const gatewayMethodsKey = JSON.stringify(params.coreGatewayMethodNames ?? []);
821825return `${roots.workspace ?? ""}::${roots.global ?? ""}::${roots.stock ?? ""}::${JSON.stringify({
822826 ...params.plugins,
823827 installs,
824828 loadPaths,
825829 activationMetadataKey: params.activationMetadataKey ?? "",
826- })}::${scopeKey}::${setupOnlyKey}::${setupOnlyModeKey}::${setupOnlyRequirementKey}::${startupChannelMode}::${moduleLoadMode}::${runtimeSubagentMode}::${params.pluginSdkResolution ?? "auto"}::${gatewayMethodsKey}`;
830+ })}::${scopeKey}::${setupOnlyKey}::${setupOnlyModeKey}::${setupOnlyRequirementKey}::${startupChannelMode}::${moduleLoadMode}::${bundledRuntimeDepsMode}::${runtimeSubagentMode}::${params.pluginSdkResolution ?? "auto"}::${gatewayMethodsKey}`;
827831}
828832829833function matchesScopedPluginRequest(params: {
@@ -901,6 +905,7 @@ function hasExplicitCompatibilityInputs(options: PluginLoadOptions): boolean {
901905options.forceSetupOnlyChannelPlugins === true ||
902906options.requireSetupEntryForSetupOnlyChannelPlugins === true ||
903907options.preferSetupRuntimeForChannelPlugins === true ||
908+options.installBundledRuntimeDeps === false ||
904909options.loadModules === false
905910);
906911}
@@ -926,6 +931,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
926931const requireSetupEntryForSetupOnlyChannelPlugins =
927932options.requireSetupEntryForSetupOnlyChannelPlugins === true;
928933const preferSetupRuntimeForChannelPlugins = options.preferSetupRuntimeForChannelPlugins === true;
934+const shouldInstallBundledRuntimeDeps = options.installBundledRuntimeDeps !== false;
929935const runtimeSubagentMode = resolveRuntimeSubagentMode(options.runtimeOptions);
930936const coreGatewayMethodNames = Object.keys(options.coreGatewayHandlers ?? {}).toSorted();
931937const cacheKey = buildCacheKey({
@@ -943,6 +949,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
943949 requireSetupEntryForSetupOnlyChannelPlugins,
944950 preferSetupRuntimeForChannelPlugins,
945951loadModules: options.loadModules,
952+installBundledRuntimeDeps: options.installBundledRuntimeDeps,
946953 runtimeSubagentMode,
947954pluginSdkResolution: options.pluginSdkResolution,
948955 coreGatewayMethodNames,
@@ -961,6 +968,7 @@ function resolvePluginLoadCacheContext(options: PluginLoadOptions = {}) {
961968 preferSetupRuntimeForChannelPlugins,
962969shouldActivate: options.activate !== false,
963970shouldLoadModules: options.loadModules !== false,
971+ shouldInstallBundledRuntimeDeps,
964972 runtimeSubagentMode,
965973 cacheKey,
966974};
@@ -1839,6 +1847,7 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
18391847 preferSetupRuntimeForChannelPlugins,
18401848 shouldActivate,
18411849 shouldLoadModules,
1850+ shouldInstallBundledRuntimeDeps,
18421851 cacheKey,
18431852 runtimeSubagentMode,
18441853} = resolvePluginLoadCacheContext(options);
@@ -2183,7 +2192,12 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
21832192markPluginActivationDisabled(record, enableState.reason);
21842193}
218521942186-if (shouldLoadModules && candidate.origin === "bundled" && enableState.enabled) {
2195+if (
2196+shouldLoadModules &&
2197+shouldInstallBundledRuntimeDeps &&
2198+candidate.origin === "bundled" &&
2199+enableState.enabled
2200+) {
21872201try {
21882202const installRoot = resolveBundledRuntimeDependencyInstallRoot(pluginRoot, { env });
21892203const retainSpecs = bundledRuntimeDepsRetainSpecsByInstallRoot.get(installRoot) ?? [];
@@ -2426,7 +2440,7 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
24262440manifestRecord.setupSource
24272441) {
24282442const setupRegistration = resolveSetupChannelRegistration(mod, {
2429-installRuntimeDeps: enableState.enabled,
2443+installRuntimeDeps: shouldInstallBundledRuntimeDeps && enableState.enabled,
24302444});
24312445if (setupRegistration.loadError) {
24322446recordPluginError({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。