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

推荐订阅源

V
Visual Studio Blog
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
The Cloudflare Blog
D
DataBreaches.Net
J
Java Code Geeks
G
Google Developers Blog
L
LangChain Blog
N
Netflix TechBlog - Medium
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
小众软件
小众软件
量子位
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
博客园_首页
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
腾讯CDC

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(update): centralize timeout seconds parsing · opencla...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -57,14 +57,15 @@ describe("createGlobalCommandRunner", () => {

5757

try {

5858

expect(parseTimeoutMsOrExit("1.5")).toBeNull();

5959

expect(parseTimeoutMsOrExit("10abc")).toBeNull();

60+

expect(parseTimeoutMsOrExit("0x10")).toBeNull();

6061

expect(parseTimeoutMsOrExit("0")).toBeNull();

6162

expect(parseTimeoutMsOrExit("-1")).toBeNull();

6263

expect(parseTimeoutMsOrExit(" ")).toBeNull();

6364

expect(parseTimeoutMsOrExit(String(Number.MAX_SAFE_INTEGER))).toBeNull();

6465
65-

expect(error).toHaveBeenCalledTimes(6);

66+

expect(error).toHaveBeenCalledTimes(7);

6667

expect(error).toHaveBeenCalledWith("--timeout must be a positive integer (seconds)");

67-

expect(exit).toHaveBeenCalledTimes(6);

68+

expect(exit).toHaveBeenCalledTimes(7);

6869

expect(exit).toHaveBeenCalledWith(1);

6970

} finally {

7071

error.mockRestore();

@@ -78,6 +79,7 @@ describe("createGlobalCommandRunner", () => {

7879
7980

try {

8081

expect(parseTimeoutMsOrExit(" 10 ")).toBe(10_000);

82+

expect(parseTimeoutMsOrExit("+10")).toBe(10_000);

8183

expect(parseTimeoutMsOrExit("001")).toBe(1_000);

8284

expect(parseTimeoutMsOrExit()).toBeUndefined();

8385

expect(error).not.toHaveBeenCalled();

Original file line numberDiff line numberDiff line change

@@ -6,6 +6,7 @@ import { resolveRequiredHomeDir } from "../../infra/home-dir.js";

66

import { resolveOpenClawPackageRoot } from "../../infra/openclaw-root.js";

77

import { readPackageName, readPackageVersion } from "../../infra/package-json.js";

88

import { normalizePackageTagInput } from "../../infra/package-tag.js";

9+

import { parseStrictPositiveInteger } from "../../infra/parse-finite-number.js";

910

import { trimLogTail } from "../../infra/restart-sentinel.js";

1011

import { parseSemver } from "../../infra/runtime-guard.js";

1112

import { fetchNpmTagVersion } from "../../infra/update-check.js";

@@ -60,13 +61,8 @@ export function parseTimeoutMsOrExit(timeout?: string): number | undefined | nul

6061

return undefined;

6162

}

6263

const trimmed = timeout.trim();

63-

const seconds = Number(trimmed);

64-

if (

65-

!/^\d+$/u.test(trimmed) ||

66-

!Number.isSafeInteger(seconds) ||

67-

seconds <= 0 ||

68-

seconds > MAX_SAFE_TIMEOUT_SECONDS

69-

) {

64+

const seconds = parseStrictPositiveInteger(trimmed);

65+

if (seconds === undefined || seconds > MAX_SAFE_TIMEOUT_SECONDS) {

7066

defaultRuntime.error(INVALID_TIMEOUT_ERROR);

7167

defaultRuntime.exit(1);

7268

return null;