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

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Jina AI
Jina AI
GbyAI
GbyAI
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
P
Proofpoint News Feed
The Cloudflare Blog
H
Help Net Security
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
量子位
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
月光博客
月光博客

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: dedupe chat directive mock reads · openclaw/opencla...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -389,8 +389,17 @@ function getMessageContent(payload: unknown): Array<Record<string, any>> {

389389

return Array.isArray(content) ? (content as Array<Record<string, any>>) : [];

390390

}

391391392+

function mockCallAt(

393+

mock: { mock: { calls: ReadonlyArray<ReadonlyArray<unknown>> } },

394+

index: number,

395+

): ReadonlyArray<unknown> | undefined {

396+

const calls = mock.mock.calls;

397+

const normalizedIndex = index < 0 ? calls.length + index : index;

398+

return calls[normalizedIndex];

399+

}

400+392401

function lastRespondCall(respond: ReturnType<typeof vi.fn>) {

393-

return respond.mock.calls.at(-1) as

402+

return mockCallAt(respond, -1) as

394403

| [boolean, Record<string, any> | undefined, Record<string, any> | undefined]

395404

| undefined;

396405

}

@@ -410,13 +419,13 @@ function responseErrorMessage(error: unknown): string {

410419

}

411420412421

function lastBroadcastPayload(context: ChatContext): Record<string, any> | undefined {

413-

const chatCall = (context.broadcast as unknown as ReturnType<typeof vi.fn>).mock.calls.at(-1);

422+

const chatCall = mockCallAt(context.broadcast as unknown as ReturnType<typeof vi.fn>, -1);

414423

expect(chatCall?.[0]).toBe("chat");

415424

return chatCall?.[1] as Record<string, any> | undefined;

416425

}

417426418427

function lastNodeSendCall(context: ChatContext) {

419-

return (context.nodeSendToSession as unknown as ReturnType<typeof vi.fn>).mock.calls.at(-1) as

428+

return mockCallAt(context.nodeSendToSession as unknown as ReturnType<typeof vi.fn>, -1) as

420429

| [string, string, Record<string, any>]

421430

| undefined;

422431

}

@@ -553,7 +562,7 @@ async function runNonStreamingChatSend(params: {

553562

waitForCompletion?: boolean;

554563

waitForDedupe?: boolean;

555564

waitFor?: NonStreamingChatSendWaitFor;

556-

}) {

565+

}): Promise<Record<string, any> | undefined> {

557566

const sendParams: {

558567

sessionKey: string;

559568

message: string;

@@ -604,11 +613,9 @@ async function runNonStreamingChatSend(params: {

604613

).toBe(1);

605614

});

606615607-

const chatCall = (params.context.broadcast as unknown as ReturnType<typeof vi.fn>).mock.calls.at(

608-

0,

609-

);

616+

const chatCall = mockCallAt(params.context.broadcast as unknown as ReturnType<typeof vi.fn>, 0);

610617

expect(chatCall?.[0]).toBe("chat");

611-

return chatCall?.[1];

618+

return chatCall?.[1] as Record<string, any> | undefined;

612619

}

613620614621

describe("chat directive tag stripping for non-streaming final payloads", () => {

@@ -1096,7 +1103,7 @@ describe("chat directive tag stripping for non-streaming final payloads", () =>

10961103

});

1097110410981105

expect(respond).toHaveBeenCalled();

1099-

const chatCall = (context.broadcast as unknown as ReturnType<typeof vi.fn>).mock.calls.at(-1);

1106+

const chatCall = mockCallAt(context.broadcast as unknown as ReturnType<typeof vi.fn>, -1);

11001107

expect(chatCall?.[0]).toBe("chat");

11011108

expect(extractFirstTextBlock(chatCall?.[1])).toBe("hello");

11021109

});

@@ -2978,9 +2985,10 @@ describe("chat directive tag stripping for non-streaming final payloads", () =>

29782985

expect(payload).toBeUndefined();

29792986

expect(error?.code).toBe(ErrorCodes.UNAVAILABLE);

29802987

expect(responseErrorMessage(error)).toMatch(/ENOSPC|non-image attachments/i);

2981-

const unavailableLogCall = (

2982-

context.logGateway.error as unknown as ReturnType<typeof vi.fn>

2983-

).mock.calls.at(0) as [string, Record<string, string>] | undefined;

2988+

const unavailableLogCall = mockCallAt(

2989+

context.logGateway.error as unknown as ReturnType<typeof vi.fn>,

2990+

0,

2991+

) as [string, Record<string, string>] | undefined;

29842992

expect(unavailableLogCall?.[0]).toBe("chat.send attachment parse/stage failed");

29852993

expect(unavailableLogCall?.[1].consoleMessage).toContain(

29862994

"chat.send attachment parse/stage failed: MediaOffloadError",