

























@@ -4,6 +4,7 @@ import os from "node:os";
44import path from "node:path";
55import { afterEach, describe, expect, it, vi } from "vitest";
66import {
7+__testing as bundledRuntimeDepsTesting,
78createBundledRuntimeDependencyAliasMap,
89createBundledRuntimeDepsInstallArgs,
910createBundledRuntimeDepsInstallEnv,
@@ -656,6 +657,16 @@ describe("ensureBundledPluginRuntimeDeps", () => {
656657]);
657658});
658659660+it("does not expire active runtime-deps install locks by age alone", () => {
661+expect(
662+bundledRuntimeDepsTesting.shouldRemoveRuntimeDepsLock(
663+{ pid: 123, createdAtMs: 0 },
664+Number.MAX_SAFE_INTEGER,
665+() => true,
666+),
667+).toBe(false);
668+});
669+659670it("removes stale runtime-deps install locks before repairing deps", () => {
660671const packageRoot = makeTempDir();
661672const pluginRoot = path.join(packageRoot, "dist", "extensions", "openai");
@@ -670,10 +681,7 @@ describe("ensureBundledPluginRuntimeDeps", () => {
670681);
671682const lockDir = path.join(pluginRoot, ".openclaw-runtime-deps.lock");
672683fs.mkdirSync(lockDir, { recursive: true });
673-fs.writeFileSync(
674-path.join(lockDir, "owner.json"),
675-JSON.stringify({ pid: process.pid, createdAtMs: 0 }),
676-);
684+fs.writeFileSync(path.join(lockDir, "owner.json"), JSON.stringify({ pid: 0, createdAtMs: 0 }));
677685678686const calls: BundledRuntimeDepsInstallParams[] = [];
679687const result = ensureBundledPluginRuntimeDeps({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。