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

推荐订阅源

D
Docker
博客园 - 三生石上(FineUI控件)
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
爱范儿
爱范儿
博客园 - 【当耐特】
雷峰网
雷峰网
S
SegmentFault 最新的问题
美团技术团队
Blog — PlanetScale
Blog — PlanetScale
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
J
Java Code Geeks

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(gateway-client): cap stop wait timeout · openclaw/ope...
steipete · 2026-05-30 · via Recent Commits to openclaw:main

File tree

  • packages/gateway-client/src

Original file line numberDiff line numberDiff line change

@@ -688,9 +688,9 @@ export class GatewayClient {

688688

return;

689689

}

690690

const timeoutMs =

691-

typeof opts?.timeoutMs === "number" && Number.isFinite(opts.timeoutMs)

692-

? Math.max(1, Math.floor(opts.timeoutMs))

693-

: STOP_AND_WAIT_TIMEOUT_MS;

691+

opts?.timeoutMs === undefined

692+

? STOP_AND_WAIT_TIMEOUT_MS

693+

: resolveSafeTimeoutDelayMs(opts.timeoutMs);

694694

let timeout: NodeJS.Timeout | null = null;

695695

try {

696696

await Promise.race([

Original file line numberDiff line numberDiff line change

@@ -5,6 +5,7 @@ import { WebSocket, WebSocketServer } from "ws";

55

import { GatewayClient, resolveGatewayClientConnectChallengeTimeoutMs } from "./client.js";

66

import {

77

DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS,

8+

MAX_SAFE_TIMEOUT_DELAY_MS,

89

MAX_CONNECT_CHALLENGE_TIMEOUT_MS,

910

MIN_CONNECT_CHALLENGE_TIMEOUT_MS,

1011

} from "./timeouts.js";

@@ -418,6 +419,33 @@ describe("GatewayClient", () => {

418419

}

419420

});

420421
422+

test("clamps oversized stopAndWait timeouts before scheduling", async () => {

423+

vi.useFakeTimers();

424+

try {

425+

const client = new GatewayClient({});

426+

const ws = {

427+

readyState: WebSocket.OPEN,

428+

close: vi.fn(),

429+

terminate: vi.fn(),

430+

};

431+

(client as unknown as { ws: unknown }).ws = ws;

432+

const setTimeoutSpy = vi.spyOn(globalThis, "setTimeout");

433+
434+

const stopPromise = client.stopAndWait({ timeoutMs: Number.MAX_SAFE_INTEGER });

435+
436+

await vi.advanceTimersByTimeAsync(1);

437+

expect(ws.terminate).not.toHaveBeenCalled();

438+

expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), MAX_SAFE_TIMEOUT_DELAY_MS);

439+
440+

await vi.advanceTimersByTimeAsync(249);

441+

await expect(stopPromise).resolves.toBeUndefined();

442+

expect(ws.terminate).toHaveBeenCalledTimes(1);

443+

} finally {

444+

vi.useRealTimers();

445+

vi.restoreAllMocks();

446+

}

447+

});

448+
421449

test("rejects mismatched tls fingerprint", async () => {

422450

const key = [

423451

"-----BEGIN PRIVATE KEY-----", // pragma: allowlist secret