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

推荐订阅源

N
Netflix TechBlog - Medium
I
InfoQ
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
Docker
Microsoft Security Blog
Microsoft Security Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
博客园 - Franky
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
WordPress大学
WordPress大学
MyScale Blog
MyScale 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
test: tighten whatsapp reconnect assertions · openclaw/op...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -78,6 +78,29 @@ async function startWatchdogScenario(params: {

7878

return { scripted, sleep, spies, ...started };

7979

}

808081+

function expectErrorContaining(errorFn: unknown, text: string): void {

82+

const messages = ((errorFn as { mock?: { calls?: unknown[][] } }).mock?.calls ?? []).map((call) =>

83+

typeof call[0] === "string" ? call[0] : call[0] instanceof Error ? call[0].message : "",

84+

);

85+

expect(messages.some((message) => message.includes(text))).toBe(true);

86+

}

87+88+

function mockCallArg(mocked: unknown, callIndex: number, argIndex: number): unknown {

89+

const calls = (mocked as { mock?: { calls?: unknown[][] } }).mock?.calls;

90+

expect(calls?.[callIndex]).toBeDefined();

91+

return calls?.[callIndex]?.[argIndex];

92+

}

93+94+

async function expectPathMissing(targetPath: string): Promise<void> {

95+

try {

96+

await fs.stat(targetPath);

97+

} catch (error) {

98+

expect((error as { code?: unknown }).code).toBe("ENOENT");

99+

return;

100+

}

101+

throw new Error(`Expected path to be missing: ${targetPath}`);

102+

}

103+81104

describe("web auto-reply connection", () => {

82105

installWebAutoReplyUnitTestHooks();

83106

@@ -140,7 +163,7 @@ describe("web auto-reply connection", () => {

140163

await run;

141164

}

142165143-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining(scenario.expectedError));

166+

expectErrorContaining(runtime.error, scenario.expectedError);

144167

}

145168

});

146169

@@ -186,9 +209,9 @@ describe("web auto-reply connection", () => {

186209

expect(completedQuickly).toBe(true);

187210

expect(scripted.getListenerCount()).toBe(1);

188211

expect(sleep).not.toHaveBeenCalled();

189-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("status 440"));

190-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("session conflict"));

191-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("Stopping web monitoring"));

212+

expectErrorContaining(runtime.error, "status 440");

213+

expectErrorContaining(runtime.error, "session conflict");

214+

expectErrorContaining(runtime.error, "Stopping web monitoring");

192215

});

193216194217

it.each([

@@ -260,20 +283,14 @@ describe("web auto-reply connection", () => {

260283

expect(scripted.getListenerCount()).toBe(1);

261284

expect(sleep).not.toHaveBeenCalled();

262285

expect(getActiveWebListener(accountId)).toBeNull();

263-

await expect(fs.stat(authDir)).rejects.toMatchObject({ code: "ENOENT" });

264-

expect(statuses).toContainEqual(

265-

expect.objectContaining({

266-

connected: false,

267-

healthState,

268-

}),

269-

);

270-

expect(statuses.at(-1)).toEqual(

271-

expect.objectContaining({

272-

running: false,

273-

connected: false,

274-

healthState,

275-

}),

276-

);

286+

await expectPathMissing(authDir);

287+

expect(

288+

statuses.some((entry) => entry.connected === false && entry.healthState === healthState),

289+

).toBe(true);

290+

const finalStatus = statuses.at(-1);

291+

expect(finalStatus?.running).toBe(false);

292+

expect(finalStatus?.connected).toBe(false);

293+

expect(finalStatus?.healthState).toBe(healthState);

277294

},

278295

);

279296

@@ -304,8 +321,9 @@ describe("web auto-reply connection", () => {

304321

controller.abort();

305322

await run;

306323307-

expect(sleep).toHaveBeenCalledWith(expect.any(Number), expect.any(AbortSignal));

308-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("inbox attach"));

324+

expect(typeof mockCallArg(sleep, 0, 0)).toBe("number");

325+

expect(mockCallArg(sleep, 0, 1)).toBeInstanceOf(AbortSignal);

326+

expectErrorContaining(runtime.error, "inbox attach");

309327

});

310328311329

it("stops retrying inbox attach when auth stays unstable past max attempts", async () => {

@@ -326,8 +344,8 @@ describe("web auto-reply connection", () => {

326344327345

expect(listenerFactory).toHaveBeenCalledTimes(2);

328346

expect(sleep).toHaveBeenCalledTimes(1);

329-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("Retry 1/2"));

330-

expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("Stopping web monitoring"));

347+

expectErrorContaining(runtime.error, "Retry 1/2");

348+

expectErrorContaining(runtime.error, "Stopping web monitoring");

331349

});

332350333351

it("forces reconnect when watchdog closes without onClose", async () => {