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

推荐订阅源

MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
U
Unit 42
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog
C
Check Point Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
Vercel News
Vercel News
腾讯CDC
GbyAI
GbyAI
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 三生石上(FineUI控件)
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
小众软件
小众软件

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(node-runtime): keep node-host recovering after gatewa...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -83,6 +83,12 @@ type FingerprintCheckingClientOptions = Omit<ClientOptions, "checkServerIdentity

8383

checkServerIdentity?: (servername: string, cert: CertMeta) => Error | undefined;

8484

};

858586+

export type GatewayReconnectPausedInfo = {

87+

code: number;

88+

reason: string;

89+

detailCode: string | null;

90+

};

91+8692

export class GatewayClientRequestError extends Error {

8793

readonly gatewayCode: string;

8894

readonly details?: unknown;

@@ -130,6 +136,7 @@ export type GatewayClientOptions = {

130136

onEvent?: (evt: EventFrame) => void;

131137

onHelloOk?: (hello: HelloOk) => void;

132138

onConnectError?: (err: Error) => void;

139+

onReconnectPaused?: (info: GatewayReconnectPausedInfo) => void;

133140

onClose?: (code: number, reason: string) => void;

134141

onGap?: (info: { expected: number; received: number }) => void;

135142

};

@@ -190,6 +197,7 @@ export class GatewayClient {

190197

private connectNonce: string | null = null;

191198

private connectSent = false;

192199

private connectTimer: NodeJS.Timeout | null = null;

200+

private reconnectTimer: NodeJS.Timeout | null = null;

193201

private pendingDeviceTokenRetry = false;

194202

private deviceTokenRetryBudgetUsed = false;

195203

private pendingConnectErrorDetailCode: string | null = null;

@@ -219,6 +227,7 @@ export class GatewayClient {

219227

if (this.closed) {

220228

return;

221229

}

230+

this.clearReconnectTimer();

222231

this.clearConnectChallengeTimeout();

223232

this.connectNonce = null;

224233

this.connectSent = false;

@@ -332,6 +341,11 @@ export class GatewayClient {

332341

}

333342

this.flushPendingErrors(new Error(`gateway closed (${code}): ${reasonText}`));

334343

if (this.shouldPauseReconnectAfterAuthFailure(connectErrorDetailCode)) {

344+

this.opts.onReconnectPaused?.({

345+

code,

346+

reason: reasonText,

347+

detailCode: connectErrorDetailCode,

348+

});

335349

this.opts.onClose?.(code, reasonText);

336350

return;

337351

}

@@ -384,6 +398,7 @@ export class GatewayClient {

384398

this.pendingDeviceTokenRetry = false;

385399

this.deviceTokenRetryBudgetUsed = false;

386400

this.pendingConnectErrorDetailCode = null;

401+

this.clearReconnectTimer();

387402

if (this.tickTimer) {

388403

clearInterval(this.tickTimer);

389404

this.tickTimer = null;

@@ -817,6 +832,13 @@ export class GatewayClient {

817832

}

818833

}

819834835+

private clearReconnectTimer() {

836+

if (this.reconnectTimer) {

837+

clearTimeout(this.reconnectTimer);

838+

this.reconnectTimer = null;

839+

}

840+

}

841+820842

private armConnectChallengeTimeout() {

821843

const connectChallengeTimeoutMs = resolveGatewayClientConnectChallengeTimeoutMs(this.opts);

822844

const armedAt = Date.now();

@@ -843,9 +865,13 @@ export class GatewayClient {

843865

clearInterval(this.tickTimer);

844866

this.tickTimer = null;

845867

}

868+

this.clearReconnectTimer();

846869

const delay = this.backoffMs;

847870

this.backoffMs = Math.min(this.backoffMs * 2, 30_000);

848-

setTimeout(() => this.start(), delay).unref();

871+

this.reconnectTimer = setTimeout(() => {

872+

this.reconnectTimer = null;

873+

this.start();

874+

}, delay);

849875

}

850876851877

private flushPendingErrors(err: Error) {