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

推荐订阅源

博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
腾讯CDC
J
Java Code Geeks
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
雷峰网
雷峰网
B
Blog RSS Feed
博客园_首页
量子位
F
Fortinet All Blogs
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point 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: remove channel test isolation hack · openclaw/openc...
steipete · 2026-05-31 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -18,6 +18,7 @@ async function withFakeTimers(run: () => Promise<void>) {

1818

} finally {

1919

vi.clearAllTimers();

2020

vi.useRealTimers();

21+

vi.restoreAllMocks();

2122

}

2223

}

2324

@@ -62,8 +63,11 @@ describe("createTypingCallbacks", () => {

6263

});

6364
6465

afterEach(() => {

65-

vi.clearAllTimers();

66+

if (vi.isFakeTimers()) {

67+

vi.clearAllTimers();

68+

}

6669

vi.useRealTimers();

70+

vi.restoreAllMocks();

6771

});

6872
6973

it("invokes start on reply start", async () => {

@@ -211,15 +215,19 @@ describe("createTypingCallbacks", () => {

211215
212216

it("clamps oversized keepalive intervals before arming timers", async () => {

213217

await withFakeTimers(async () => {

214-

const setIntervalSpy = vi.spyOn(globalThis, "setInterval");

215-

const { callbacks } = createTypingHarness({

218+

const { start, callbacks } = createTypingHarness({

216219

keepaliveIntervalMs: Number.MAX_SAFE_INTEGER,

220+

maxDurationMs: 0,

217221

});

218222
219223

await callbacks.onReplyStart();

220224

await flushMicrotasks();

221225
222-

expect(setIntervalSpy).toHaveBeenCalledWith(expect.any(Function), MAX_TIMER_TIMEOUT_MS);

226+

expect(vi.getTimerCount()).toBe(1);

227+

await vi.advanceTimersByTimeAsync(MAX_TIMER_TIMEOUT_MS - 1);

228+

expect(start).toHaveBeenCalledTimes(1);

229+

await vi.advanceTimersByTimeAsync(1);

230+

expect(start).toHaveBeenCalledTimes(2);

223231

callbacks.onCleanup?.();

224232

});

225233

});

@@ -387,15 +395,23 @@ describe("createTypingCallbacks", () => {

387395
388396

it("clamps oversized TTLs before arming timers", async () => {

389397

await withFakeTimers(async () => {

390-

const setTimeoutSpy = vi.spyOn(globalThis, "setTimeout");

391-

const { callbacks } = createTypingHarness({

398+

const consoleWarn = vi.spyOn(console, "warn").mockImplementation(() => {});

399+

const { stop, callbacks } = createTypingHarness({

400+

keepaliveIntervalMs: 0,

392401

maxDurationMs: Number.MAX_SAFE_INTEGER,

393402

});

394403
395404

await callbacks.onReplyStart();

396405

await flushMicrotasks();

397406
398-

expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), MAX_TIMER_TIMEOUT_MS);

407+

expect(vi.getTimerCount()).toBe(1);

408+

await vi.advanceTimersByTimeAsync(MAX_TIMER_TIMEOUT_MS - 1);

409+

expect(stop).not.toHaveBeenCalled();

410+

await vi.advanceTimersByTimeAsync(1);

411+

expect(stop).toHaveBeenCalledTimes(1);

412+

expect(consoleWarn).toHaveBeenCalledWith(

413+

`[typing] TTL exceeded (${MAX_TIMER_TIMEOUT_MS}ms), auto-stopping typing indicator`,

414+

);

399415

callbacks.onCleanup?.();

400416

});

401417

});