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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
小众软件
小众软件
美团技术团队
Martin Fowler
Martin Fowler
爱范儿
爱范儿
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
J
Java Code Geeks
B
Blog
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
博客园 - Franky

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
fix(e2e): clean npm update guest scripts · openclaw/openc...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,7 +1,7 @@

11

#!/usr/bin/env -S pnpm tsx

2+

import { spawn } from "node:child_process";

23

// Npm Update Smoke script supports OpenClaw repository automation.

34

import { randomUUID } from "node:crypto";

4-

import { spawn } from "node:child_process";

55

import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";

66

import { copyFile, readFile, rm } from "node:fs/promises";

77

import path from "node:path";

@@ -1109,23 +1109,32 @@ export class NpmUpdateSmoke {

11091109

if (write.status !== 0) {

11101110

throw new Error(`failed to write guest script ${scriptPath}: ${write.stderr.trim()}`);

11111111

}

1112-

const chmod = run("prlctl", ["exec", vm, "/bin/chmod", "755", scriptPath], {

1113-

check: false,

1114-

quiet: true,

1115-

timeoutMs: 30_000,

1116-

});

1117-

if (chmod.status !== 0) {

1118-

throw new Error(`failed to chmod guest script ${scriptPath}: ${chmod.stderr.trim()}`);

1112+

try {

1113+

const chmod = run("prlctl", ["exec", vm, "/bin/chmod", "755", scriptPath], {

1114+

check: false,

1115+

quiet: true,

1116+

timeoutMs: 30_000,

1117+

});

1118+

if (chmod.status !== 0) {

1119+

throw new Error(`failed to chmod guest script ${scriptPath}: ${chmod.stderr.trim()}`);

1120+

}

1121+

} catch (error) {

1122+

this.removeGuestScript(vm, scriptPath);

1123+

throw error;

11191124

}

11201125

return scriptPath;

11211126

}

11221127
11231128

private removeGuestScript(vm: string, scriptPath: string): void {

1124-

run("prlctl", ["exec", vm, "/bin/rm", "-f", scriptPath], {

1125-

check: false,

1126-

quiet: true,

1127-

timeoutMs: 30_000,

1128-

});

1129+

try {

1130+

run("prlctl", ["exec", vm, "/bin/rm", "-f", scriptPath], {

1131+

check: false,

1132+

quiet: true,

1133+

timeoutMs: 30_000,

1134+

});

1135+

} catch {

1136+

// Cleanup must not hide the update failure that made the log useful.

1137+

}

11291138

}

11301139
11311140

private async runStreamingToJobLog(

Original file line numberDiff line numberDiff line change

@@ -1,5 +1,5 @@

11

// Parallels Npm Update Smoke tests cover parallels npm update smoke script behavior.

2-

import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";

2+

import { chmodSync, existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";

33

import { tmpdir } from "node:os";

44

import path from "node:path";

55

import { afterEach, describe, expect, it } from "vitest";

@@ -121,6 +121,71 @@ describe("parallels npm update smoke", () => {

121121

expect(stopCalls).toBe(1);

122122

});

123123
124+

it("removes uploaded guest update scripts when chmod fails", () => {

125+

const root = makeTempDir();

126+

const logPath = path.join(root, "prlctl.log");

127+

const prlctlPath = path.join(root, "prlctl");

128+

writeFileSync(

129+

prlctlPath,

130+

`#!/usr/bin/env bash

131+

set -euo pipefail

132+

log_path=${JSON.stringify(logPath)}

133+

printf '%s\\n' "$*" >>"$log_path"

134+

args=" $* "

135+

if [[ "$args" == *" /usr/bin/tee /tmp/openclaw-parallels-npm-update-linux-"* ]]; then

136+

cat >/dev/null

137+

exit 0

138+

fi

139+

if [[ "$args" == *" /bin/chmod 755 /tmp/openclaw-parallels-npm-update-linux-"* ]]; then

140+

echo "chmod denied" >&2

141+

exit 7

142+

fi

143+

if [[ "$args" == *" /bin/rm -f /tmp/openclaw-parallels-npm-update-linux-"* ]]; then

144+

printf 'cleanup\\n' >>"$log_path"

145+

exit 0

146+

fi

147+

exit 1

148+

`,

149+

);

150+

chmodSync(prlctlPath, 0o755);

151+
152+

withEnv(

153+

{

154+

OPENAI_API_KEY: "test-key",

155+

PATH: `${root}${path.delimiter}${process.env.PATH ?? ""}`,

156+

},

157+

() => {

158+

const smoke = new NpmUpdateSmoke({

159+

...TEST_AUTH,

160+

json: false,

161+

packageSpec: "openclaw@latest",

162+

platforms: new Set<Platform>(["linux"]),

163+

provider: "openai",

164+

updateTarget: "local-main",

165+

});

166+

const writeGuestScript = Reflect.get(smoke, "writeGuestScript") as (

167+

vm: string,

168+

script: string,

169+

prefix: string,

170+

) => string;

171+
172+

expect(() =>

173+

writeGuestScript.call(

174+

smoke,

175+

"Linux VM",

176+

"echo update",

177+

"openclaw-parallels-npm-update-linux",

178+

),

179+

).toThrow("failed to chmod guest script");

180+

},

181+

);

182+
183+

const log = readFileSync(logPath, "utf8");

184+

expect(log).toContain("/bin/chmod 755 /tmp/openclaw-parallels-npm-update-linux-");

185+

expect(log).toContain("/bin/rm -f /tmp/openclaw-parallels-npm-update-linux-");

186+

expect(log.match(/^cleanup$/gm)).toHaveLength(1);

187+

});

188+
124189

it("has a one-command beta validation mode with fresh target coverage", () => {

125190

const script = readFileSync(SCRIPT_PATH, "utf8");

126191