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

推荐订阅源

美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
Y
Y Combinator Blog
博客园_首页
有赞技术团队
有赞技术团队
博客园 - Franky
腾讯CDC
G
Google Developers Blog
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
D
Docker
The GitHub Blog
The GitHub Blog
MyScale Blog
MyScale Blog
H
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
U
Unit 42
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学

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 package docker timers · openclaw/open...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main

@@ -17,6 +17,7 @@ const DEFAULT_TIMEOUT_KILL_AFTER_MS = 5_000;

1717

const PROCESS_GROUP_EXIT_POLL_MS = 25;

1818

const POST_FORCE_KILL_WAIT_MS = 1_000;

1919

const DEFAULT_CAPTURED_STDOUT_MAX_BYTES = 1024 * 1024;

20+

const MAX_TIMER_TIMEOUT_MS = 2_147_000_000;

2021

const ACTIVE_CHILD_KILLERS = new Set();

2122

const SIGNAL_EXIT_CODES = {

2223

SIGHUP: 129,

@@ -65,6 +66,23 @@ function resolveTimeoutMs(envName, defaultValue) {

6566

return parsed;

6667

}

676869+

function numericTimerValueMs(valueMs) {

70+

const value = Number(valueMs);

71+

return Number.isFinite(value) ? Math.floor(value) : undefined;

72+

}

73+74+

function resolveTimerTimeoutMs(valueMs, fallbackMs = MAX_TIMER_TIMEOUT_MS) {

75+

const value = numericTimerValueMs(valueMs) ?? numericTimerValueMs(fallbackMs);

76+

return Math.min(Math.max(value ?? MAX_TIMER_TIMEOUT_MS, 1), MAX_TIMER_TIMEOUT_MS);

77+

}

78+79+

function resolveOptionalTimerTimeoutMs(valueMs) {

80+

if (valueMs === undefined) {

81+

return undefined;

82+

}

83+

return resolveTimerTimeoutMs(valueMs, 1);

84+

}

85+6886

function readOptionValue(argv, index, optionName) {

6987

const value = argv[index + 1];

7088

if (value === undefined || value === "" || value.startsWith("-")) {

@@ -149,6 +167,11 @@ export function parseArgs(argv) {

149167150168

function run(command, args, cwd, options = {}) {

151169

return new Promise((resolve, reject) => {

170+

const resolvedTimeoutMs = resolveOptionalTimerTimeoutMs(options.timeoutMs);

171+

const resolvedKillAfterMs = resolveTimerTimeoutMs(

172+

options.killAfterMs,

173+

DEFAULT_TIMEOUT_KILL_AFTER_MS,

174+

);

152175

const useProcessGroup = process.platform !== "win32";

153176

const child = spawn(command, args, {

154177

cwd,

@@ -230,21 +253,21 @@ function run(command, args, cwd, options = {}) {

230253

return;

231254

}

232255

killChild("SIGKILL");

233-

}, options.killAfterMs ?? DEFAULT_TIMEOUT_KILL_AFTER_MS);

256+

}, resolvedKillAfterMs);

234257

forceKillTimeout.unref?.();

235258

};

236259

ACTIVE_CHILD_KILLERS.add(killChild);

237260

const timeout =

238-

options.timeoutMs === undefined

261+

resolvedTimeoutMs === undefined

239262

? undefined

240263

: setTimeout(() => {

241264

timedOut = true;

242265

terminateChild();

243-

}, options.timeoutMs);

266+

}, resolvedTimeoutMs);

244267

timeout?.unref?.();

245268

const finishAfterTeardown = async (error, value = "") => {

246269

if (processGroupAlive()) {

247-

await waitForProcessGroupExit(options.killAfterMs ?? DEFAULT_TIMEOUT_KILL_AFTER_MS);

270+

await waitForProcessGroupExit(resolvedKillAfterMs);

248271

}

249272

if (processGroupAlive()) {

250273

killChild("SIGKILL");

@@ -275,7 +298,7 @@ function run(command, args, cwd, options = {}) {

275298

child.on("close", (status, signal) => {

276299

if (timedOut) {

277300

void finishAfterTeardown(

278-

new Error(`${command} ${args.join(" ")} timed out after ${options.timeoutMs}ms`),

301+

new Error(`${command} ${args.join(" ")} timed out after ${resolvedTimeoutMs}ms`),

279302

);

280303

return;

281304

}