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

推荐订阅源

J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
D
Docker
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
量子位
有赞技术团队
有赞技术团队
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
B
Blog
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
月光博客
月光博客

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(scripts): clamp parallels update timeouts · openclaw/...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main

@@ -6,6 +6,11 @@ import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs

66

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

77

import path from "node:path";

88

import { pathToFileURL } from "node:url";

9+

import {

10+

addTimerTimeoutGraceMs,

11+

clampTimerTimeoutMs,

12+

finiteSecondsToTimerSafeMilliseconds,

13+

} from "@openclaw/normalization-core/number-coercion";

914

import {

1015

die,

1116

ensureValue,

@@ -121,8 +126,24 @@ interface NpmUpdateSummary {

121126

const macosVmDefault = "macOS Tahoe";

122127

const windowsVm = "Windows 11";

123128

const linuxVmDefault = "Ubuntu 26.04";

129+130+

function resolveRequiredTimerMs(timeoutMs: number): number {

131+

return clampTimerTimeoutMs(timeoutMs) ?? 1;

132+

}

133+134+

function resolveOptionalTimerMs(timeoutMs: number | undefined): number | undefined {

135+

return timeoutMs === undefined || timeoutMs <= 0 ? undefined : resolveRequiredTimerMs(timeoutMs);

136+

}

137+138+

function resolveSecondsTimerMs(timeoutSeconds: number): number {

139+

return finiteSecondsToTimerSafeMilliseconds(timeoutSeconds) ?? 1;

140+

}

141+124142

const updateTimeoutSeconds = readPositiveIntEnv("OPENCLAW_PARALLELS_NPM_UPDATE_TIMEOUT_S", 1200);

125143

const updateCleanupBackstopMs = 60_000;

144+

const updateTimeoutMs = resolveSecondsTimerMs(updateTimeoutSeconds);

145+

const updateWithCleanupTimeoutMs =

146+

addTimerTimeoutGraceMs(updateTimeoutMs, updateCleanupBackstopMs) ?? 1;

126147

const freshLaneTimeoutKillGraceMs = readPositiveIntEnv(

127148

"OPENCLAW_PARALLELS_NPM_UPDATE_FRESH_TIMEOUT_KILL_GRACE_MS",

128149

2_000,

@@ -133,7 +154,9 @@ let loggedExitCleanupInstalled = false;

133154134155

export function freshLaneTimeoutMs(platform: Platform): number {

135156

const defaultSeconds = platform === "windows" ? 90 * 60 : 75 * 60;

136-

return readPositiveIntEnv("OPENCLAW_PARALLELS_NPM_UPDATE_FRESH_TIMEOUT_S", defaultSeconds) * 1000;

157+

return resolveSecondsTimerMs(

158+

readPositiveIntEnv("OPENCLAW_PARALLELS_NPM_UPDATE_FRESH_TIMEOUT_S", defaultSeconds),

159+

);

137160

}

138161139162

export function spawnLoggedCommand(

@@ -161,19 +184,23 @@ export function spawnLoggedCommand(

161184

appendFileSync(logPath, text, "utf8");

162185

onOutput(text);

163186

};

164-

const timeoutMs = options.timeoutMs ?? 0;

187+

const timeoutMs = resolveOptionalTimerMs(options.timeoutMs);

188+

const timeoutKillGraceMs =

189+

options.timeoutKillGraceMs === undefined

190+

? resolveRequiredTimerMs(freshLaneTimeoutKillGraceMs)

191+

: resolveRequiredTimerMs(options.timeoutKillGraceMs);

165192

const timeoutTimer =

166-

timeoutMs > 0

193+

timeoutMs !== undefined

167194

? setTimeout(() => {

168195

timedOut = true;

169196

append(

170197

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

171198

);

172199

signalLoggedChild(child, "SIGTERM");

173-

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

200+

forceKillAt = Date.now() + timeoutKillGraceMs;

174201

forceKillTimer = setTimeout(

175202

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

176-

options.timeoutKillGraceMs ?? freshLaneTimeoutKillGraceMs,

203+

timeoutKillGraceMs,

177204

);

178205

}, timeoutMs)

179206

: undefined;

@@ -208,7 +235,7 @@ export function spawnLoggedCommand(

208235

if (timedOut) {

209236

void finishTimedOutLoggedProcessTree(child, {

210237

forceKillAt,

211-

timeoutKillGraceMs: options.timeoutKillGraceMs ?? freshLaneTimeoutKillGraceMs,

238+

timeoutKillGraceMs,

212239

}).then(finish, finish);

213240

return;

214241

}

@@ -926,7 +953,7 @@ export class NpmUpdateSmoke {

926953

label,

927954

run: ({ signal }) => fn({ append, logPath, signal }),

928955

timeoutDescription: `${updateTimeoutSeconds}s plus cleanup backstop`,

929-

timeoutMs: updateTimeoutSeconds * 1000 + updateCleanupBackstopMs,

956+

timeoutMs: updateWithCleanupTimeoutMs,

930957

writeLog: async () => undefined,

931958

});

932959

})().finally(() => {

@@ -937,15 +964,15 @@ export class NpmUpdateSmoke {

937964

}

938965939966

private async runMacosUpdate(ctx: UpdateJobContext): Promise<void> {

940-

await this.guestMacos(this.updateScript("macos"), updateTimeoutSeconds * 1000, ctx);

967+

await this.guestMacos(this.updateScript("macos"), updateTimeoutMs, ctx);

941968

}

942969943970

private runWindowsUpdate(ctx: UpdateJobContext): Promise<void> {

944-

return this.guestWindows(this.updateScript("windows"), updateTimeoutSeconds * 1000, ctx);

971+

return this.guestWindows(this.updateScript("windows"), updateTimeoutMs, ctx);

945972

}

946973947974

private async runLinuxUpdate(ctx: UpdateJobContext): Promise<void> {

948-

await this.guestLinux(this.updateScript("linux"), updateTimeoutSeconds * 1000, ctx);

975+

await this.guestLinux(this.updateScript("linux"), updateTimeoutMs, ctx);

949976

}

950977951978

private updateScript(platform: Platform): string {