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

推荐订阅源

Vercel News
Vercel News
博客园 - 司徒正美
C
Check Point Blog
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
IT之家
IT之家
B
Blog
博客园_首页
量子位
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
J
Java Code Geeks
H
Help Net Security
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Jina AI
Jina AI
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News

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(crestodian): cap probe timeouts · openclaw/openclaw@6...
steipete · 2026-05-30 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,7 +1,13 @@

1-

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

2-

import { probeLocalCommand } from "./probes.js";

1+

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

2+

import { probeGatewayUrl, probeLocalCommand } from "./probes.js";

3+
4+

const MAX_TIMER_TIMEOUT_MS = 2_147_000_000;

35
46

describe("crestodian probes", () => {

7+

afterEach(() => {

8+

vi.restoreAllMocks();

9+

});

10+
511

it("bounds noisy local command probe output", async () => {

612

const result = await probeLocalCommand(

713

process.execPath,

@@ -31,4 +37,21 @@ describe("crestodian probes", () => {

3137

expect(Date.now() - startedAt).toBeLessThan(2_000);

3238

},

3339

);

40+
41+

it("caps oversized gateway probe timeouts before scheduling", async () => {

42+

const timeoutSpy = vi

43+

.spyOn(globalThis, "setTimeout")

44+

.mockReturnValue(1 as unknown as ReturnType<typeof setTimeout>);

45+

vi.spyOn(globalThis, "clearTimeout").mockImplementation(() => undefined);

46+

vi.stubGlobal(

47+

"fetch",

48+

vi.fn(async () => new Response("ok", { status: 200 })),

49+

);

50+
51+

await expect(

52+

probeGatewayUrl("ws://127.0.0.1:1234", { timeoutMs: MAX_TIMER_TIMEOUT_MS + 1_000_000 }),

53+

).resolves.toMatchObject({ reachable: true });

54+
55+

expect(timeoutSpy).toHaveBeenCalledWith(expect.any(Function), MAX_TIMER_TIMEOUT_MS);

56+

});

3457

});

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,5 @@

11

import { spawn } from "node:child_process";

2+

import { resolveTimerTimeoutMs } from "../shared/number-coercion.js";

23
34

export type LocalCommandProbe = {

45

command: string;

@@ -20,9 +21,13 @@ export async function probeLocalCommand(

2021

args: string[] = ["--version"],

2122

opts: { outputLimit?: number; timeoutKillGraceMs?: number; timeoutMs?: number } = {},

2223

): Promise<LocalCommandProbe> {

23-

const timeoutMs = opts.timeoutMs ?? 1_500;

24+

const timeoutMs = resolveTimerTimeoutMs(opts.timeoutMs, 1_500);

2425

const outputLimit = opts.outputLimit ?? LOCAL_COMMAND_PROBE_OUTPUT_MAX_CHARS;

25-

const timeoutKillGraceMs = opts.timeoutKillGraceMs ?? LOCAL_COMMAND_PROBE_KILL_GRACE_MS;

26+

const timeoutKillGraceMs = resolveTimerTimeoutMs(

27+

opts.timeoutKillGraceMs,

28+

LOCAL_COMMAND_PROBE_KILL_GRACE_MS,

29+

0,

30+

);

2631

return await new Promise((resolve) => {

2732

let stdout = "";

2833

let stderr = "";

@@ -51,15 +56,12 @@ export async function probeLocalCommand(

5156

const timer = setTimeout(() => {

5257

timedOut = true;

5358

child.kill("SIGTERM");

54-

killTimer = setTimeout(

55-

() => {

56-

child.kill("SIGKILL");

57-

child.stdout.destroy();

58-

child.stderr.destroy();

59-

finish(timeoutResult());

60-

},

61-

Math.max(0, timeoutKillGraceMs),

62-

);

59+

killTimer = setTimeout(() => {

60+

child.kill("SIGKILL");

61+

child.stdout.destroy();

62+

child.stderr.destroy();

63+

finish(timeoutResult());

64+

}, timeoutKillGraceMs);

6365

killTimer.unref?.();

6466

}, timeoutMs);

6567

child.stdout.setEncoding("utf8");

@@ -99,8 +101,9 @@ export async function probeGatewayUrl(

99101

): Promise<{ reachable: boolean; url: string; error?: string }> {

100102

const httpUrl = url.replace(/^ws:/, "http:").replace(/^wss:/, "https:");

101103

const healthUrl = new URL("/healthz", httpUrl).toString();

104+

const timeoutMs = resolveTimerTimeoutMs(opts.timeoutMs, 900);

102105

const controller = new AbortController();

103-

const timeout = setTimeout(() => controller.abort(), opts.timeoutMs ?? 900);

106+

const timeout = setTimeout(() => controller.abort(), timeoutMs);

104107

try {

105108

const response = await fetch(healthUrl, {

106109

method: "GET",