





















@@ -2645,6 +2645,41 @@ describe("ensureBundledPluginRuntimeDeps", () => {
26452645expect(path.basename(resolved).startsWith("openclaw-unknown-")).toBe(false);
26462646});
264726472648+const itSupportsPackageRootSymlinks = process.platform === "win32" ? it.skip : it;
2649+itSupportsPackageRootSymlinks(
2650+"stages bundled runtime deps to the same root for symlinked packageRoot views (issue #74963)",
2651+() => {
2652+const realParent = makeTempDir();
2653+const stageDir = makeTempDir();
2654+const realPackageRoot = path.join(realParent, "openclaw-real");
2655+fs.mkdirSync(realPackageRoot, { recursive: true });
2656+fs.writeFileSync(
2657+path.join(realPackageRoot, "package.json"),
2658+JSON.stringify({ name: "openclaw", version: "2026.4.27" }),
2659+);
2660+const realPluginRoot = path.join(realPackageRoot, "dist", "extensions", "discord");
2661+fs.mkdirSync(realPluginRoot, { recursive: true });
2662+fs.writeFileSync(
2663+path.join(realPluginRoot, "package.json"),
2664+JSON.stringify({ dependencies: {} }),
2665+);
2666+const linkedPackageRoot = path.join(realParent, "openclaw-linked");
2667+fs.symlinkSync(realPackageRoot, linkedPackageRoot, "dir");
2668+const linkedPluginRoot = path.join(linkedPackageRoot, "dist", "extensions", "discord");
2669+const env = { OPENCLAW_PLUGIN_STAGE_DIR: stageDir };
2670+2671+const installRootViaReal = resolveBundledRuntimeDependencyInstallRoot(realPluginRoot, {
2672+ env,
2673+});
2674+const installRootViaLink = resolveBundledRuntimeDependencyInstallRoot(linkedPluginRoot, {
2675+ env,
2676+});
2677+2678+expect(installRootViaLink).toBe(installRootViaReal);
2679+expect(path.basename(installRootViaReal)).toMatch(/^openclaw-2026\.4\.27-[0-9a-f]{12}$/);
2680+},
2681+);
2682+26482683it("prunes stale unknown external runtime roots while keeping newest and locked roots", () => {
26492684const stageDir = makeTempDir();
26502685const nowMs = Date.parse("2026-04-29T08:00:00.000Z");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。