惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
博客园_首页
S
SegmentFault 最新的问题
罗磊的独立博客
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
D
Docker
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
V
V2EX
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
腾讯CDC
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
Vercel News
Vercel News
H
Help Net Security
博客园 - Franky
D
DataBreaches.Net
aimingoo的专栏
aimingoo的专栏

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: make root permission assertions deterministic · ope...
vincentkoc · 2026-05-14 · via Recent Commits to openclaw:main

@@ -477,36 +477,53 @@ describe("runGlobalPackageUpdateSteps", () => {

477477

await fs.mkdir(path.dirname(targetShim), { recursive: true });

478478

await fs.writeFile(targetShim, "old shim\n", "utf8");

479479480-

const result = await runGlobalPackageUpdateSteps({

481-

installTarget: createNpmTarget(globalRoot),

482-

installSpec: "openclaw@2.0.0",

483-

packageName: "openclaw",

484-

packageRoot,

485-

runCommand: createRootRunner(globalRoot),

486-

runStep: async ({ name, argv, cwd }) => {

487-

const prefixIndex = argv.indexOf("--prefix");

488-

const stagePrefix = argv[prefixIndex + 1];

489-

if (!stagePrefix) {

490-

throw new Error("missing staged prefix");

480+

let stagedShimForFailure: string | undefined;

481+

const realCopyFile = fs.copyFile.bind(fs);

482+

const copyFileSpy = vi

483+

.spyOn(fs, "copyFile")

484+

.mockImplementation(async (...args: Parameters<typeof fs.copyFile>) => {

485+

const [source] = args;

486+

if (stagedShimForFailure && String(source) === stagedShimForFailure) {

487+

throw createFsError("EACCES", "staged shim copy failed");

491488

}

492-

await writePackageRoot(

493-

path.join(stagePrefix, "lib", "node_modules", "openclaw"),

494-

"2.0.0",

495-

);

496-

const stagedShim = path.join(stagePrefix, "bin", "openclaw");

497-

await fs.mkdir(path.dirname(stagedShim), { recursive: true });

498-

await fs.writeFile(stagedShim, "new shim\n", "utf8");

499-

await fs.chmod(stagedShim, 0);

500-

return {

501-

name,

502-

command: argv.join(" "),

503-

cwd: cwd ?? process.cwd(),

504-

durationMs: 1,

505-

exitCode: 0,

506-

};

507-

},

508-

timeoutMs: 1000,

509-

});

489+

return await realCopyFile(...args);

490+

});

491+492+

let result: Awaited<ReturnType<typeof runGlobalPackageUpdateSteps>>;

493+

try {

494+

result = await runGlobalPackageUpdateSteps({

495+

installTarget: createNpmTarget(globalRoot),

496+

installSpec: "openclaw@2.0.0",

497+

packageName: "openclaw",

498+

packageRoot,

499+

runCommand: createRootRunner(globalRoot),

500+

runStep: async ({ name, argv, cwd }) => {

501+

const prefixIndex = argv.indexOf("--prefix");

502+

const stagePrefix = argv[prefixIndex + 1];

503+

if (!stagePrefix) {

504+

throw new Error("missing staged prefix");

505+

}

506+

await writePackageRoot(

507+

path.join(stagePrefix, "lib", "node_modules", "openclaw"),

508+

"2.0.0",

509+

);

510+

const stagedShim = path.join(stagePrefix, "bin", "openclaw");

511+

stagedShimForFailure = stagedShim;

512+

await fs.mkdir(path.dirname(stagedShim), { recursive: true });

513+

await fs.writeFile(stagedShim, "new shim\n", "utf8");

514+

return {

515+

name,

516+

command: argv.join(" "),

517+

cwd: cwd ?? process.cwd(),

518+

durationMs: 1,

519+

exitCode: 0,

520+

};

521+

},

522+

timeoutMs: 1000,

523+

});

524+

} finally {

525+

copyFileSpy.mockRestore();

526+

}

510527511528

expect(result.failedStep?.name).toBe("global install swap");

512529

expect(result.verifiedPackageRoot).toBe(packageRoot);