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

推荐订阅源

小众软件
小众软件
博客园_首页
博客园 - 聂微东
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
D
Docker
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
B
Blog RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
Jina AI
Jina AI
博客园 - Franky
D
DataBreaches.Net

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): contain lifecycle callback errors · opencla...
vincentkoc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -748,6 +748,22 @@ describe("GatewayClient close handling", () => {

748748

client.stop();

749749

});

750750751+

it("keeps close callback errors inside websocket dispatch", () => {

752+

const onClose = vi.fn(() => {

753+

throw new Error("close callback failed");

754+

});

755+

const client = createClientWithIdentity("dev-4", onClose);

756+757+

client.start();

758+

expect(() => getLatestWs().emitClose(1008, "unauthorized: signature invalid")).not.toThrow();

759+760+

expect(onClose).toHaveBeenCalledWith(1008, "unauthorized: signature invalid");

761+

expect(logDebugMock).toHaveBeenCalledWith(

762+

"gateway client close handler error: Error: close callback failed",

763+

);

764+

client.stop();

765+

});

766+751767

it("keeps a managed reconnect timer after gateway restart closes", async () => {

752768

vi.useFakeTimers();

753769

try {

@@ -1224,6 +1240,35 @@ describe("GatewayClient connect auth payload", () => {

12241240

}

12251241

});

122612421243+

it("keeps hello callback errors inside connect dispatch", async () => {

1244+

const onHelloOk = vi.fn(() => {

1245+

throw new Error("hello callback failed");

1246+

});

1247+

const onConnectError = vi.fn();

1248+

const client = new GatewayClient({

1249+

url: "ws://127.0.0.1:18789",

1250+

deviceIdentity: null,

1251+

onHelloOk,

1252+

onConnectError,

1253+

});

1254+1255+

try {

1256+

const { ws, connect } = startClientAndConnect({ client });

1257+1258+

expect(() => emitHelloOk(ws, connect.id)).not.toThrow();

1259+

await vi.waitFor(() => {

1260+

expect(onHelloOk).toHaveBeenCalledOnce();

1261+

});

1262+

expect(onConnectError).not.toHaveBeenCalled();

1263+

expect(ws.lastClose).toBeNull();

1264+

expect(logDebugMock).toHaveBeenCalledWith(

1265+

"gateway client hello-ok handler error: Error: hello callback failed",

1266+

);

1267+

} finally {

1268+

client.stop();

1269+

}

1270+

});

1271+12271272

function emitConnectFailure(

12281273

ws: MockWebSocket,

12291274

connectId: string | undefined,

@@ -1728,6 +1773,37 @@ describe("GatewayClient connect auth payload", () => {

17281773

});

17291774

});

173017751776+

it("keeps reconnect paused callback errors inside close dispatch", async () => {

1777+

const onReconnectPaused = vi.fn(() => {

1778+

throw new Error("paused callback failed");

1779+

});

1780+

const onClose = vi.fn();

1781+

const client = new GatewayClient({

1782+

url: "ws://127.0.0.1:18789",

1783+

token: "shared-token",

1784+

onReconnectPaused,

1785+

onClose,

1786+

});

1787+1788+

const { ws: ws1, connect: firstConnect } = startClientAndConnect({ client });

1789+

await expectNoReconnectAfterConnectFailure({

1790+

client,

1791+

firstWs: ws1,

1792+

connectId: firstConnect.id,

1793+

failureDetails: { code: "AUTH_TOKEN_MISSING" },

1794+

});

1795+1796+

expect(onReconnectPaused).toHaveBeenCalledWith({

1797+

code: 1008,

1798+

reason: "connect failed",

1799+

detailCode: "AUTH_TOKEN_MISSING",

1800+

});

1801+

expect(logDebugMock).toHaveBeenCalledWith(

1802+

"gateway client reconnect paused handler error: Error: paused callback failed",

1803+

);

1804+

expect(onClose).toHaveBeenCalledWith(1008, "connect failed");

1805+

});

1806+17311807

it("does not auto-reconnect on CLIENT_VERSION_MISMATCH connect failures", async () => {

17321808

const onReconnectPaused = vi.fn();

17331809

const client = new GatewayClient({