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

推荐订阅源

MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
博客园 - 叶小钗
A
About on SuperTechFans
Last Week in AI
Last Week in AI
量子位
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
Vercel News
Vercel News
博客园 - 司徒正美
博客园 - Franky
博客园 - 【当耐特】
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
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(bonjour): suppress ciao process crashes · openclaw/op...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -5,14 +5,22 @@ const mocks = vi.hoisted(() => ({

55

createService: vi.fn(),

66

getResponder: vi.fn(),

77

shutdown: vi.fn(),

8+

registerUncaughtExceptionHandler: vi.fn(),

89

registerUnhandledRejectionHandler: vi.fn(),

910

logger: {

1011

info: vi.fn(),

1112

warn: vi.fn(),

1213

debug: vi.fn(),

1314

},

1415

}));

15-

const { createService, getResponder, shutdown, registerUnhandledRejectionHandler, logger } = mocks;

16+

const {

17+

createService,

18+

getResponder,

19+

shutdown,

20+

registerUncaughtExceptionHandler,

21+

registerUnhandledRejectionHandler,

22+

logger,

23+

} = mocks;

16241725

const asString = (value: unknown, fallback: string) =>

1826

typeof value === "string" && value.trim() ? value : fallback;

@@ -77,6 +85,7 @@ const startAdvertiser = (

7785

): ReturnType<StartGatewayBonjourAdvertiser> =>

7886

startGatewayBonjourAdvertiser(opts, {

7987

logger,

88+

registerUncaughtExceptionHandler: (handler) => registerUncaughtExceptionHandler(handler),

8089

registerUnhandledRejectionHandler: (handler) => registerUnhandledRejectionHandler(handler),

8190

});

8291

@@ -103,6 +112,7 @@ describe("gateway bonjour advertiser", () => {

103112

createService.mockClear();

104113

getResponder.mockReset();

105114

shutdown.mockClear();

115+

registerUncaughtExceptionHandler.mockClear();

106116

registerUnhandledRejectionHandler.mockClear();

107117

logger.info.mockClear();

108118

logger.warn.mockClear();

@@ -220,7 +230,7 @@ describe("gateway bonjour advertiser", () => {

220230

await started.stop();

221231

});

222232223-

it("does not install a process-level unhandled rejection handler by default", async () => {

233+

it("does not install process-level ciao handlers by default", async () => {

224234

enableAdvertiserUnitMode();

225235226236

const destroy = vi.fn().mockResolvedValue(undefined);

@@ -237,11 +247,12 @@ describe("gateway bonjour advertiser", () => {

237247

);

238248239249

expect(processOn).not.toHaveBeenCalledWith("unhandledRejection", expect.any(Function));

250+

expect(processOn).not.toHaveBeenCalledWith("uncaughtException", expect.any(Function));

240251241252

await started.stop();

242253

});

243254244-

it("cleans up unhandled rejection handler after shutdown", async () => {

255+

it("cleans up ciao process handlers after shutdown", async () => {

245256

enableAdvertiserUnitMode();

246257247258

const destroy = vi.fn().mockResolvedValue(undefined);

@@ -252,10 +263,14 @@ describe("gateway bonjour advertiser", () => {

252263

});

253264

mockCiaoService({ advertise, destroy });

254265255-

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

256-

order.push("cleanup");

266+

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

267+

order.push("cleanup-exception");

257268

});

258-

registerUnhandledRejectionHandler.mockImplementation(() => cleanup);

269+

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

270+

order.push("cleanup-rejection");

271+

});

272+

registerUncaughtExceptionHandler.mockImplementation(() => cleanupException);

273+

registerUnhandledRejectionHandler.mockImplementation(() => cleanupRejection);

259274260275

const started = await startAdvertiser({

261276

gatewayPort: 18789,

@@ -264,9 +279,11 @@ describe("gateway bonjour advertiser", () => {

264279265280

await started.stop();

266281282+

expect(registerUncaughtExceptionHandler).toHaveBeenCalledTimes(1);

267283

expect(registerUnhandledRejectionHandler).toHaveBeenCalledTimes(1);

268-

expect(cleanup).toHaveBeenCalledTimes(1);

269-

expect(order).toEqual(["shutdown", "cleanup"]);

284+

expect(cleanupException).toHaveBeenCalledTimes(1);

285+

expect(cleanupRejection).toHaveBeenCalledTimes(1);

286+

expect(order).toEqual(["shutdown", "cleanup-exception", "cleanup-rejection"]);

270287

});

271288272289

it("logs ciao handler classifications at the bonjour caller", async () => {

@@ -284,7 +301,11 @@ describe("gateway bonjour advertiser", () => {

284301

const handler = registerUnhandledRejectionHandler.mock.calls[0]?.[0] as

285302

| ((reason: unknown) => boolean)

286303

| undefined;

304+

const exceptionHandler = registerUncaughtExceptionHandler.mock.calls[0]?.[0] as

305+

| ((reason: unknown) => boolean)

306+

| undefined;

287307

expect(handler).toBeTypeOf("function");

308+

expect(exceptionHandler).toBeTypeOf("function");

288309289310

expect(handler?.(new Error("CIAO PROBING CANCELLED"))).toBe(true);

290311

expect(logger.debug).toHaveBeenCalledWith(

@@ -299,6 +320,21 @@ describe("gateway bonjour advertiser", () => {

299320

expect.stringContaining("suppressing ciao interface assertion"),

300321

);

301322323+

logger.warn.mockClear();

324+

expect(

325+

exceptionHandler?.(

326+

Object.assign(

327+

new Error(

328+

"IP address version must match. Netmask cannot have a version different from the address!",

329+

),

330+

{ name: "AssertionError" },

331+

),

332+

),

333+

).toBe(true);

334+

expect(logger.warn).toHaveBeenCalledWith(

335+

expect.stringContaining("suppressing ciao netmask assertion"),

336+

);

337+302338

await started.stop();

303339

});

304340