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

推荐订阅源

Y
Y Combinator Blog
MyScale Blog
MyScale Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
V
V2EX
MongoDB | Blog
MongoDB | Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - 三生石上(FineUI控件)
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
H
Help Net Security
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
T
The Blog of Author Tim Ferriss
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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: guard feishu reply dispatcher mock calls · openclaw...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -177,7 +177,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

177177

chatId: "oc_chat",

178178

});

179179180-

return createReplyDispatcherWithTypingMock.mock.calls[0]?.[0];

180+

return createReplyDispatcherWithTypingMock.mock.calls.at(0)?.[0];

181181

}

182182183183

function createRuntimeLogger() {

@@ -227,7 +227,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

227227

callIndex = 0,

228228

argIndex = 0,

229229

): Record<string, unknown> {

230-

return expectRecordFields(mock.mock.calls[callIndex]?.[argIndex], label, expected);

230+

return expectRecordFields(mock.mock.calls.at(callIndex)?.[argIndex], label, expected);

231231

}

232232233233

function expectLastMockArgFields(

@@ -248,9 +248,9 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

248248

if (!start) {

249249

throw new Error(`Expected streaming instance ${instanceIndex}`);

250250

}

251-

expect(start.mock.calls[0]?.[0]).toBe("oc_chat");

252-

expect(start.mock.calls[0]?.[1]).toBe("chat_id");

253-

return expectRecordFields(start.mock.calls[0]?.[2], "streaming start options", expected);

251+

expect(start.mock.calls.at(0)?.[0]).toBe("oc_chat");

252+

expect(start.mock.calls.at(0)?.[1]).toBe("chat_id");

253+

return expectRecordFields(start.mock.calls.at(0)?.[2], "streaming start options", expected);

254254

}

255255256256

function streamingUpdateTexts(instanceIndex = 0): string[] {

@@ -280,7 +280,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

280280

replyToMessageId: "om_parent",

281281

});

282282283-

const options = createReplyDispatcherWithTypingMock.mock.calls[0]?.[0];

283+

const options = createReplyDispatcherWithTypingMock.mock.calls.at(0)?.[0];

284284

await options.onReplyStart?.();

285285286286

expect(addTypingIndicatorMock).not.toHaveBeenCalled();

@@ -296,7 +296,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

296296

messageCreateTimeMs: Date.now() - 3 * 60_000,

297297

});

298298299-

const options = createReplyDispatcherWithTypingMock.mock.calls[0]?.[0];

299+

const options = createReplyDispatcherWithTypingMock.mock.calls.at(0)?.[0];

300300

await options.onReplyStart?.();

301301302302

expect(addTypingIndicatorMock).not.toHaveBeenCalled();

@@ -312,7 +312,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

312312

messageCreateTimeMs: Math.floor((Date.now() - 3 * 60_000) / 1000),

313313

});

314314315-

const options = createReplyDispatcherWithTypingMock.mock.calls[0]?.[0];

315+

const options = createReplyDispatcherWithTypingMock.mock.calls.at(0)?.[0];

316316

await options.onReplyStart?.();

317317318318

expect(addTypingIndicatorMock).not.toHaveBeenCalled();

@@ -328,7 +328,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

328328

messageCreateTimeMs: Date.now() - 30_000,

329329

});

330330331-

const options = createReplyDispatcherWithTypingMock.mock.calls[0]?.[0];

331+

const options = createReplyDispatcherWithTypingMock.mock.calls.at(0)?.[0];

332332

await options.onReplyStart?.();

333333334334

expect(addTypingIndicatorMock).toHaveBeenCalledTimes(1);

@@ -353,7 +353,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

353353

await options.deliver({ text: "plain text" }, { kind: "final" });

354354355355

expect(sendMessageFeishuMock).toHaveBeenCalledTimes(1);

356-

expect(sendMessageFeishuMock.mock.calls[0]?.[0]).not.toHaveProperty("mentions");

356+

expect(sendMessageFeishuMock.mock.calls.at(0)?.[0]).not.toHaveProperty("mentions");

357357

});

358358359359

it("does not attach automatic mentions to card replies", async () => {

@@ -374,7 +374,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

374374

await options.deliver({ text: "card text" }, { kind: "final" });

375375376376

expect(sendStructuredCardFeishuMock).toHaveBeenCalledTimes(1);

377-

expect(sendStructuredCardFeishuMock.mock.calls[0]?.[0]).not.toHaveProperty("mentions");

377+

expect(sendStructuredCardFeishuMock.mock.calls.at(0)?.[0]).not.toHaveProperty("mentions");

378378

});

379379380380

it("suppresses internal block payload delivery", async () => {

@@ -1017,7 +1017,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

10171017

}

1018101810191019

expect(streamingInstances[0].close).toHaveBeenCalledTimes(1);

1020-

const closeArg = streamingInstances[0].close.mock.calls[0][0] as string;

1020+

const closeArg = streamingInstances[0].close.mock.calls.at(0)?.[0] as string;

10211021

expect(closeArg).toContain("> 💭 **Thinking**");

10221022

expect(closeArg).toContain("---");

10231023

expect(closeArg).toContain("answer part final");

@@ -1075,7 +1075,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

1075107510761076

expect(streamingInstances).toHaveLength(1);

10771077

expect(streamingInstances[0].close).toHaveBeenCalledTimes(1);

1078-

const closeArg = streamingInstances[0].close.mock.calls[0][0] as string;

1078+

const closeArg = streamingInstances[0].close.mock.calls.at(0)?.[0] as string;

10791079

expect(closeArg).toContain("> 💭 **Thinking**");

10801080

expect(closeArg).toContain("> deep thought");

10811081

expect(closeArg).not.toContain("Reasoning:");

@@ -1095,7 +1095,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

10951095

await options.onIdle?.();

1096109610971097

expect(streamingInstances).toHaveLength(1);

1098-

const closeArg = streamingInstances[0].close.mock.calls[0][0] as string;

1098+

const closeArg = streamingInstances[0].close.mock.calls.at(0)?.[0] as string;

10991099

expect(closeArg).not.toContain("Thinking");

11001100

expect(closeArg).toBe("```ts\ncode\n```");

11011101

});

@@ -1432,7 +1432,7 @@ describe("createFeishuReplyDispatcher streaming behavior", () => {

14321432

chatId: "oc_chat",

14331433

});

143414341435-

const options = createReplyDispatcherWithTypingMock.mock.calls[0]?.[0];

1435+

const options = createReplyDispatcherWithTypingMock.mock.calls.at(0)?.[0];

1436143614371437

// First deliver with markdown triggers startStreaming - which will fail

14381438

await options.deliver({ text: "```ts\nconst x = 1\n```" }, { kind: "final" });