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

推荐订阅源

WordPress大学
WordPress大学
H
Help Net Security
Jina AI
Jina AI
V
V2EX
G
Google Developers Blog
B
Blog
GbyAI
GbyAI
U
Unit 42
爱范儿
爱范儿
腾讯CDC
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
小众软件
小众软件
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
博客园 - 聂微东
The Cloudflare Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏

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): preserve fresh lane timeout grace · openclaw/op...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main

@@ -41,6 +41,9 @@ import { linuxUpdateScript, macosUpdateScript, windowsUpdateScript } from "./npm

4141

import { ensureVmRunning, resolveMacosVmName, resolveUbuntuVmName } from "./parallels-vm.ts";

4242

import { runTimedUpdateJob } from "./update-job-timeout.ts";

434344+

const LOGGED_PROCESS_TREE_EXIT_POLL_MS = 25;

45+

const LOGGED_POST_FORCE_KILL_WAIT_MS = 1_000;

46+4447

interface NpmUpdateOptions {

4548

betaValidation?: string;

4649

freshTargetSpec?: string;

@@ -151,6 +154,7 @@ export function spawnLoggedCommand(

151154

let timedOut = false;

152155

let settled = false;

153156

let forceKillTimer: NodeJS.Timeout | undefined;

157+

let forceKillAt: number | undefined;

154158

const append = (text: string) => {

155159

appendFileSync(logPath, text, "utf8");

156160

onOutput(text);

@@ -164,6 +168,7 @@ export function spawnLoggedCommand(

164168

`\n[${options.timeoutLabel ?? `${command} ${args.join(" ")}`} timed out after ${timeoutMs}ms]\n`,

165169

);

166170

signalLoggedChild(child, "SIGTERM");

171+

forceKillAt = Date.now() + (options.timeoutKillGraceMs ?? freshLaneTimeoutKillGraceMs);

167172

forceKillTimer = setTimeout(

168173

() => signalLoggedChild(child, "SIGKILL"),

169174

options.timeoutKillGraceMs ?? freshLaneTimeoutKillGraceMs,

@@ -193,11 +198,19 @@ export function spawnLoggedCommand(

193198

settled = true;

194199

clearTimeout(timeoutTimer);

195200

clearTimeout(forceKillTimer);

196-

if (timedOut && loggedProcessTreeIsAlive(child)) {

197-

signalLoggedChild(child, "SIGKILL");

201+

const finish = () => {

202+

forceKillAt = undefined;

203+

untrackLoggedChild(child);

204+

resolve(timedOut ? 124 : (code ?? 1));

205+

};

206+

if (timedOut) {

207+

void finishTimedOutLoggedProcessTree(child, {

208+

forceKillAt,

209+

timeoutKillGraceMs: options.timeoutKillGraceMs ?? freshLaneTimeoutKillGraceMs,

210+

}).then(finish, finish);

211+

return;

198212

}

199-

untrackLoggedChild(child);

200-

resolve(timedOut ? 124 : (code ?? 1));

213+

finish();

201214

});

202215

});

203216

}

@@ -266,6 +279,43 @@ function loggedProcessTreeIsAlive(child: ReturnType<typeof spawn>): boolean {

266279

}

267280

}

268281282+

async function waitForLoggedProcessTreeExit(

283+

child: ReturnType<typeof spawn>,

284+

timeoutMs: number,

285+

): Promise<boolean> {

286+

const deadlineAt = Date.now() + timeoutMs;

287+

while (Date.now() < deadlineAt) {

288+

if (!loggedProcessTreeIsAlive(child)) {

289+

return true;

290+

}

291+

await new Promise((resolvePoll) => {

292+

setTimeout(resolvePoll, LOGGED_PROCESS_TREE_EXIT_POLL_MS);

293+

});

294+

}

295+

return !loggedProcessTreeIsAlive(child);

296+

}

297+298+

async function finishTimedOutLoggedProcessTree(

299+

child: ReturnType<typeof spawn>,

300+

{

301+

forceKillAt,

302+

timeoutKillGraceMs,

303+

}: { forceKillAt: number | undefined; timeoutKillGraceMs: number },

304+

): Promise<void> {

305+

if (!loggedProcessTreeIsAlive(child)) {

306+

return;

307+

}

308+

const graceRemainingMs =

309+

forceKillAt === undefined ? timeoutKillGraceMs : Math.max(0, forceKillAt - Date.now());

310+

if (graceRemainingMs > 0) {

311+

await waitForLoggedProcessTreeExit(child, graceRemainingMs);

312+

}

313+

if (loggedProcessTreeIsAlive(child)) {

314+

signalLoggedChild(child, "SIGKILL");

315+

}

316+

await waitForLoggedProcessTreeExit(child, LOGGED_POST_FORCE_KILL_WAIT_MS);

317+

}

318+269319

function signalLoggedChild(child: ReturnType<typeof spawn>, signal: NodeJS.Signals) {

270320

if (process.platform !== "win32" && typeof child.pid === "number") {

271321

try {