


























@@ -34,6 +34,7 @@ import { buildPluginApi } from "./api-builder.js";
3434import { inspectBundleMcpRuntimeSupport } from "./bundle-mcp.js";
3535import {
3636ensureBundledPluginRuntimeDeps,
37+installBundledRuntimeDeps,
3738resolveBundledRuntimeDependencyInstallRoot,
3839type BundledRuntimeDepsInstallParams,
3940} from "./bundled-runtime-deps.js";
@@ -2325,6 +2326,8 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
23252326candidate.origin === "bundled" &&
23262327enableState.enabled
23272328) {
2329+let runtimeDepsInstallStartedAt: number | null = null;
2330+let runtimeDepsInstallSpecs: string[] = [];
23282331try {
23292332const installRoot = resolveBundledRuntimeDependencyInstallRoot(pluginRoot, { env });
23302333const retainSpecs = bundledRuntimeDepsRetainSpecsByInstallRoot.get(installRoot) ?? [];
@@ -2334,7 +2337,26 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
23342337 env,
23352338config: cfg,
23362339 retainSpecs,
2337-installDeps: options.bundledRuntimeDepsInstaller,
2340+installDeps: (installParams) => {
2341+const installSpecs = installParams.installSpecs ?? installParams.missingSpecs;
2342+runtimeDepsInstallStartedAt = Date.now();
2343+runtimeDepsInstallSpecs = installParams.missingSpecs;
2344+if (shouldActivate) {
2345+logger.info(
2346+`[plugins] ${record.id} staging bundled runtime deps (${installParams.missingSpecs.length} missing, ${installSpecs.length} install specs): ${installParams.missingSpecs.join(", ")}`,
2347+);
2348+}
2349+const installer =
2350+options.bundledRuntimeDepsInstaller ??
2351+((params: BundledRuntimeDepsInstallParams) =>
2352+installBundledRuntimeDeps({
2353+installRoot: params.installRoot,
2354+installExecutionRoot: params.installExecutionRoot,
2355+missingSpecs: params.installSpecs ?? params.missingSpecs,
2356+ env,
2357+}));
2358+installer(installParams);
2359+},
23382360});
23392361if (depsInstallResult.installedSpecs.length > 0) {
23402362bundledRuntimeDepsRetainSpecsByInstallRoot.set(
@@ -2344,8 +2366,12 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
23442366),
23452367);
23462368if (shouldActivate) {
2369+const elapsed =
2370+runtimeDepsInstallStartedAt === null
2371+ ? ""
2372+ : ` in ${Date.now() - runtimeDepsInstallStartedAt}ms`;
23472373logger.info(
2348-`[plugins] ${record.id} installed bundled runtime deps: ${depsInstallResult.installedSpecs.join(", ")}`,
2374+`[plugins] ${record.id} installed bundled runtime deps${elapsed}: ${depsInstallResult.installedSpecs.join(", ")}`,
23492375);
23502376}
23512377}
@@ -2371,6 +2397,11 @@ export function loadOpenClawPlugins(options: PluginLoadOptions = {}): PluginRegi
23712397ensureOpenClawPluginSdkAlias(path.dirname(path.dirname(pluginRoot)));
23722398}
23732399} catch (error) {
2400+if (shouldActivate && runtimeDepsInstallStartedAt !== null) {
2401+logger.error(
2402+`[plugins] ${record.id} failed to stage bundled runtime deps after ${Date.now() - runtimeDepsInstallStartedAt}ms: ${runtimeDepsInstallSpecs.join(", ")}`,
2403+);
2404+}
23742405pushPluginLoadError(`failed to install bundled runtime deps: ${String(error)}`);
23752406continue;
23762407}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。