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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
GbyAI
GbyAI
M
MIT News - Artificial intelligence
美团技术团队
罗磊的独立博客
雷峰网
雷峰网
量子位
博客园 - 【当耐特】
Last Week in AI
Last Week in AI
D
Docker
小众软件
小众软件
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
WordPress大学
WordPress大学
V
V2EX
博客园_首页
腾讯CDC
The Cloudflare Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

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): back off probing watchdog repairs · opencla...
fuller-stack · 2026-05-11 · via Recent Commits to openclaw:main

@@ -64,11 +64,16 @@ function mockCiaoService(params?: {

6464

serviceState?: string;

6565

stateRef?: { value: string };

6666

on?: ReturnType<typeof vi.fn>;

67+

listenerMap?: Map<string, (value: unknown) => void>;

6768

responder?: Record<string, unknown>;

6869

}) {

6970

const advertise = params?.advertise ?? vi.fn().mockResolvedValue(undefined);

7071

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

71-

const on = params?.on ?? vi.fn();

72+

const on =

73+

params?.on ??

74+

vi.fn((event: string, listener: (value: unknown) => void) => {

75+

params?.listenerMap?.set(event, listener);

76+

});

7277

createService.mockImplementation((options: Record<string, unknown>) => {

7378

const service = {

7479

advertise,

@@ -695,18 +700,8 @@ describe("gateway bonjour advertiser", () => {

695700

vi.useFakeTimers();

696701697702

const stateRef = { value: "probing" };

698-

let advertiseCount = 0;

699703

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

700-

const advertise = vi.fn().mockImplementation(() => {

701-

advertiseCount += 1;

702-

if (advertiseCount === 2) {

703-

stateRef.value = "announcing";

704-

}

705-

if (advertiseCount >= 3) {

706-

stateRef.value = "announced";

707-

}

708-

return Promise.resolve();

709-

});

704+

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

710705

mockCiaoService({ advertise, destroy, stateRef });

711706712707

const started = await startAdvertiser({

@@ -717,18 +712,87 @@ describe("gateway bonjour advertiser", () => {

717712

expect(createService).toHaveBeenCalledTimes(1);

718713

expect(advertise).toHaveBeenCalledTimes(1);

719714715+

setTimeout(() => {

716+

stateRef.value = "announcing";

717+

}, 10_000);

718+720719

await vi.advanceTimersByTimeAsync(25_000);

721720722721

expectWarnContaining("service stuck in announcing");

723722

expect(createService).toHaveBeenCalledTimes(2);

724-

expect(advertise).toHaveBeenCalledTimes(3);

723+

expect(advertise).toHaveBeenCalledTimes(2);

725724

expect(destroy).toHaveBeenCalledTimes(1);

726725

expect(shutdown).not.toHaveBeenCalled();

727726728727

await started.stop();

729728

expect(shutdown).toHaveBeenCalledTimes(1);

730729

});

731730731+

it("does not re-advertise while ciao is still probing", async () => {

732+

enableAdvertiserUnitMode();

733+

vi.useFakeTimers();

734+735+

const stateRef = { value: "probing" };

736+

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

737+

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

738+

mockCiaoService({ advertise, destroy, stateRef });

739+740+

const started = await startAdvertiser({

741+

gatewayPort: 18789,

742+

sshPort: 2222,

743+

});

744+745+

expect(advertise).toHaveBeenCalledTimes(1);

746+747+

await vi.advanceTimersByTimeAsync(15_000);

748+749+

expect(advertise).toHaveBeenCalledTimes(1);

750+

expect(createService).toHaveBeenCalledTimes(1);

751+

expect(logger.warn).not.toHaveBeenCalledWith(

752+

expect.stringContaining("watchdog detected non-announced service; attempting re-advertise"),

753+

);

754+755+

await vi.advanceTimersByTimeAsync(10_000);

756+757+

expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining("service stuck in probing"));

758+

expect(createService).toHaveBeenCalledTimes(2);

759+760+

await started.stop();

761+

});

762+763+

it("defers probing recovery while a name conflict is still settling", async () => {

764+

enableAdvertiserUnitMode();

765+

vi.useFakeTimers();

766+767+

const stateRef = { value: "probing" };

768+

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

769+

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

770+

const listenerMap = new Map<string, (value: unknown) => void>();

771+

mockCiaoService({ advertise, destroy, stateRef, listenerMap });

772+773+

const started = await startAdvertiser({

774+

gatewayPort: 18789,

775+

sshPort: 2222,

776+

});

777+778+

await vi.advanceTimersByTimeAsync(10_000);

779+

listenerMap.get("name-change")?.("test-host (OpenClaw) (2)");

780+781+

await vi.advanceTimersByTimeAsync(15_000);

782+783+

expect(createService).toHaveBeenCalledTimes(1);

784+

expect(logger.warn).toHaveBeenCalledWith(

785+

expect.stringContaining('name conflict resolved; newName="test-host (OpenClaw) (2)"'),

786+

);

787+788+

await vi.advanceTimersByTimeAsync(20_000);

789+790+

expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining("service stuck in probing"));

791+

expect(createService).toHaveBeenCalledTimes(2);

792+793+

await started.stop();

794+

});

795+732796

it("disables bonjour for the process after repeated stuck advertiser restarts", async () => {

733797

enableAdvertiserUnitMode();

734798

vi.useFakeTimers();