




















@@ -6,7 +6,10 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
66import { measureDiagnosticsTimelineSpan } from "../infra/diagnostics-timeline.js";
77import { resolveOpenClawPackageRootSync } from "../infra/openclaw-root.js";
88import { registerBundledRuntimeDependencyJitiAliases } from "../plugins/bundled-runtime-deps-jiti-aliases.js";
9-import { pruneUnknownBundledRuntimeDepsRoots } from "../plugins/bundled-runtime-deps-roots.js";
9+import {
10+isSourceCheckoutRoot,
11+pruneUnknownBundledRuntimeDepsRoots,
12+} from "../plugins/bundled-runtime-deps-roots.js";
1013import { repairBundledRuntimeDepsPackagePlanAsync } from "../plugins/bundled-runtime-deps.js";
1114import { prepareBundledPluginRuntimeLoadRoot } from "../plugins/bundled-runtime-root.js";
1215import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
@@ -106,6 +109,7 @@ async function prestageGatewayBundledRuntimeDepsImpl(params: {
106109}
107110prestageGatewayBundledRuntimeMirrors({
108111 ...params,
112+ ...(packageRoot ? { packageRoot } : {}),
109113previousRepairError: repairError,
110114});
111115return repairError === undefined ? {} : { repairError };
@@ -116,9 +120,14 @@ function prestageGatewayBundledRuntimeMirrors(params: {
116120manifestRegistry: PluginManifestRegistry;
117121pluginIds: readonly string[];
118122log: GatewayPluginBootstrapLog;
123+packageRoot?: string;
119124previousRepairError?: unknown;
120125}): void {
121126const pluginIdSet = new Set(params.pluginIds);
127+const allowSourceCheckoutRepair =
128+params.previousRepairError === undefined &&
129+typeof params.packageRoot === "string" &&
130+isSourceCheckoutRoot(params.packageRoot);
122131const startedAt = Date.now();
123132const preparedPluginIds: string[] = [];
124133for (const record of params.manifestRegistry.plugins) {
@@ -133,10 +142,15 @@ function prestageGatewayBundledRuntimeMirrors(params: {
133142 ...(record.setupSource ? { setupModulePath: record.setupSource } : {}),
134143env: process.env,
135144config: params.cfg,
136-installMissingDeps: false,
145+installMissingDeps: allowSourceCheckoutRepair,
137146previousRepairError: params.previousRepairError,
138147memoizePreparedRoot: true,
139148registerRuntimeAliasRoot: registerBundledRuntimeDependencyJitiAliases,
149+logInstalled: (installedSpecs) => {
150+params.log.info(
151+`[plugins] ${record.id} installed bundled runtime deps in source checkout pre-stage: ${installedSpecs.join(", ")}`,
152+);
153+},
140154});
141155preparedPluginIds.push(record.id);
142156} catch (error) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。