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

推荐订阅源

云风的 BLOG
云风的 BLOG
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
Recent Announcements
Recent Announcements
B
Blog
D
Docker
V
V2EX
GbyAI
GbyAI
L
LangChain Blog
博客园 - Franky
U
Unit 42
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
博客园_首页
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
量子位
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客

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): bound upgrade survivor config commands · opencl...
vincentkoc · 2026-06-01 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -7,6 +7,8 @@ import { buildCmdExeCommandLine } from "../../../windows-cmd-helpers.mjs";

77
88

const args = process.argv.slice(2);

99

const command = args.shift();

10+

export const CONFIG_COMMAND_TIMEOUT_MS = 120_000;

11+

export const CONFIG_COMMAND_MAX_BUFFER_BYTES = 4 * 1024 * 1024;

1012
1113

function option(name, fallback) {

1214

const index = args.indexOf(name);

@@ -217,21 +219,34 @@ export function resolveUpgradeSurvivorOpenClawCommand(argv, params = {}) {

217219

};

218220

}

219221
220-

function runOpenClaw(step) {

222+

function errorCode(error) {

223+

return error && typeof error === "object" && "code" in error ? String(error.code) : undefined;

224+

}

225+
226+

export function runUpgradeSurvivorOpenClawStep(step, params = {}) {

221227

const invocation = resolveUpgradeSurvivorOpenClawCommand(step.argv);

222-

const result = spawnSync(invocation.command, invocation.args, {

228+

const run = params.spawnSyncCommand ?? spawnSync;

229+

const timeoutMs = params.timeoutMs ?? CONFIG_COMMAND_TIMEOUT_MS;

230+

const maxBuffer = params.maxBufferBytes ?? CONFIG_COMMAND_MAX_BUFFER_BYTES;

231+

const result = run(invocation.command, invocation.args, {

223232

encoding: "utf8",

224233

env: process.env,

234+

killSignal: "SIGTERM",

235+

maxBuffer,

225236

shell: invocation.shell,

237+

timeout: timeoutMs,

226238

windowsVerbatimArguments: invocation.windowsVerbatimArguments,

227239

});

240+

const code = errorCode(result.error);

228241

return {

229242

id: step.id,

230243

intent: step.intent,

231244

command: invocation.commandLabel,

232245

status: result.status,

233246

signal: result.signal,

234-

ok: result.status === 0,

247+

ok: result.status === 0 && !result.error,

248+

errorCode: code,

249+

errorMessage: result.error?.message ? tail(result.error.message) : undefined,

235250

stdout: tail(result.stdout),

236251

stderr: tail(result.stderr),

237252

};

@@ -268,11 +283,12 @@ function applyRecipe() {

268283

if (!adaptedStep) {

269284

continue;

270285

}

271-

const outcome = runOpenClaw(adaptedStep);

286+

const outcome = runUpgradeSurvivorOpenClawStep(adaptedStep);

272287

summary.steps.push(outcome);

273288

writeJson(summaryPath, summary);

274289

if (!outcome.ok) {

275-

throw new Error(`baseline config recipe failed at ${step.id}`);

290+

const detail = outcome.errorCode ?? outcome.signal ?? outcome.status ?? "unknown";

291+

throw new Error(`baseline config recipe failed at ${step.id}: ${detail}`);

276292

}

277293

}

278294

}

Original file line numberDiff line numberDiff line change

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

11

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

2-

import { resolveUpgradeSurvivorOpenClawCommand } from "../../scripts/e2e/lib/upgrade-survivor/config-recipe.mjs";

2+

import {

3+

CONFIG_COMMAND_MAX_BUFFER_BYTES,

4+

CONFIG_COMMAND_TIMEOUT_MS,

5+

resolveUpgradeSurvivorOpenClawCommand,

6+

runUpgradeSurvivorOpenClawStep,

7+

} from "../../scripts/e2e/lib/upgrade-survivor/config-recipe.mjs";

38
49

describe("upgrade survivor config recipe command resolution", () => {

510

it("wraps Windows openclaw npm shims through cmd.exe", () => {

@@ -38,4 +43,52 @@ describe("upgrade survivor config recipe command resolution", () => {

3843

shell: false,

3944

});

4045

});

46+
47+

it("bounds baseline config commands and reports spawn errors", () => {

48+

const calls: unknown[] = [];

49+

const timeoutError = Object.assign(new Error("spawnSync openclaw ETIMEDOUT"), {

50+

code: "ETIMEDOUT",

51+

});

52+
53+

const outcome = runUpgradeSurvivorOpenClawStep(

54+

{

55+

argv: ["config", "validate"],

56+

id: "validate",

57+

intent: "validate",

58+

},

59+

{

60+

spawnSyncCommand(command: string, args: string[], options: unknown) {

61+

calls.push({ args, command, options });

62+

return {

63+

error: timeoutError,

64+

signal: "SIGTERM",

65+

status: null,

66+

stderr: "still validating",

67+

stdout: "partial output",

68+

};

69+

},

70+

},

71+

);

72+
73+

expect(calls).toHaveLength(1);

74+

expect(calls[0]).toMatchObject({

75+

args: ["config", "validate"],

76+

command: "openclaw",

77+

options: {

78+

killSignal: "SIGTERM",

79+

maxBuffer: CONFIG_COMMAND_MAX_BUFFER_BYTES,

80+

timeout: CONFIG_COMMAND_TIMEOUT_MS,

81+

},

82+

});

83+

expect(outcome).toMatchObject({

84+

command: "openclaw config validate",

85+

errorCode: "ETIMEDOUT",

86+

errorMessage: "spawnSync openclaw ETIMEDOUT",

87+

ok: false,

88+

signal: "SIGTERM",

89+

status: null,

90+

stderr: "still validating",

91+

stdout: "partial output",

92+

});

93+

});

4194

});