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

推荐订阅源

MyScale Blog
MyScale Blog
博客园 - 司徒正美
A
About on SuperTechFans
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
F
Fortinet All Blogs
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
D
Docker
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
H
Help Net Security
量子位
IT之家
IT之家

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): quiet startup retry closes · openclaw/openc...
steipete · 2026-05-16 · via Recent Commits to openclaw:main

@@ -3,7 +3,12 @@ import { describe, expect, it, vi } from "vitest";

33

import type { WebSocketServer } from "ws";

44

import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../protocol/client-info.js";

55

import { PROTOCOL_VERSION } from "../protocol/index.js";

6-

import { GATEWAY_STARTUP_UNAVAILABLE_REASON } from "../protocol/startup-unavailable.js";

6+

import {

7+

GATEWAY_STARTUP_CLOSE_CODE,

8+

GATEWAY_STARTUP_CLOSE_REASON,

9+

GATEWAY_STARTUP_PENDING_CLOSE_CAUSE,

10+

GATEWAY_STARTUP_UNAVAILABLE_REASON,

11+

} from "../protocol/startup-unavailable.js";

712

import { attachGatewayWsConnectionHandler } from "./ws-connection.js";

813914

function createLogger() {

@@ -51,6 +56,7 @@ describe("attachGatewayWsConnectionHandler startup readiness", () => {

5156

headers: { host: "127.0.0.1:19001" },

5257

socket: { localAddress: "127.0.0.1" },

5358

};

59+

const logWsControl = createLogger();

54605561

attachGatewayWsConnectionHandler({

5662

wss,

@@ -64,7 +70,7 @@ describe("attachGatewayWsConnectionHandler startup readiness", () => {

6470

refreshHealthSnapshot: vi.fn(async () => ({}) as never),

6571

logGateway: createLogger() as never,

6672

logHealth: createLogger() as never,

67-

logWsControl: createLogger() as never,

73+

logWsControl: logWsControl as never,

6874

extraHandlers: {},

6975

broadcast: vi.fn(),

7076

buildRequestContext: () => createRequestContext() as never,

@@ -134,7 +140,25 @@ describe("attachGatewayWsConnectionHandler startup readiness", () => {

134140

expect(response?.error?.retryAfterMs).toBe(500);

135141

expect(response?.error?.details).toEqual({ reason: GATEWAY_STARTUP_UNAVAILABLE_REASON });

136142

await vi.waitFor(() => {

137-

expect(socket.close).toHaveBeenCalledWith(1013, "gateway starting");

143+

expect(socket.close).toHaveBeenCalledWith(

144+

GATEWAY_STARTUP_CLOSE_CODE,

145+

GATEWAY_STARTUP_CLOSE_REASON,

146+

);

138147

});

148+

expect(logWsControl.debug).toHaveBeenCalledWith(

149+

expect.stringContaining("closed before connect"),

150+

expect.objectContaining({

151+

cause: GATEWAY_STARTUP_PENDING_CLOSE_CAUSE,

152+

handshake: "failed",

153+

}),

154+

);

155+

expect(logWsControl.debug).toHaveBeenCalledWith(

156+

expect.stringContaining(`code=${GATEWAY_STARTUP_CLOSE_CODE}`),

157+

expect.anything(),

158+

);

159+

expect(logWsControl.warn).not.toHaveBeenCalledWith(

160+

expect.stringContaining("closed before connect"),

161+

expect.anything(),

162+

);

139163

});

140164

});