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

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
U
Unit 42
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
IT之家
IT之家
MyScale Blog
MyScale Blog
V
Visual Studio Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
I
InfoQ
博客园 - 司徒正美

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 matrix group history mock calls · openclaw/o...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -141,11 +141,22 @@ function createFinalDeliveryFailureHandler(finalizeInboundContext: (ctx: unknown

141141

}

142142143143

function inboundHistoryBodies(finalizeInboundContext: ReturnType<typeof vi.fn>, callIndex: number) {

144-

const ctx = finalizeInboundContext.mock.calls[callIndex]?.[0] as Record<string, unknown>;

144+

const ctx = finalizeInboundContextCall(finalizeInboundContext, callIndex);

145145

const history = ctx["InboundHistory"] as Array<{ body: string }> | undefined;

146146

return history?.map((entry) => entry.body) ?? [];

147147

}

148148149+

function finalizeInboundContextCall(

150+

finalizeInboundContext: ReturnType<typeof vi.fn>,

151+

callIndex: number,

152+

) {

153+

const ctx = finalizeInboundContext.mock.calls.at(callIndex)?.[0];

154+

if (!ctx || typeof ctx !== "object") {

155+

throw new Error(`Expected finalizeInboundContext call ${callIndex + 1}`);

156+

}

157+

return ctx as Record<string, unknown>;

158+

}

159+149160

function expectSomeBodyContaining(bodies: readonly string[], fragment: string) {

150161

expect(bodies.some((body) => body.includes(fragment))).toBe(true);

151162

}

@@ -175,7 +186,7 @@ describe("matrix group chat history — scenario 1: basic accumulation", () => {

175186

// Trigger B — history must contain [msg A] only, not the trigger itself

176187

await handler(DEFAULT_ROOM, makeRoomTriggerEvent({ eventId: "$b", body: "msg B", ts: 2000 }));

177188

expect(finalizeInboundContext).toHaveBeenCalledOnce();

178-

const ctx = finalizeInboundContext.mock.calls[0]?.[0] as Record<string, unknown>;

189+

const ctx = finalizeInboundContextCall(finalizeInboundContext, 0);

179190

const history = ctx["InboundHistory"] as Array<{ body: string; sender: string }>;

180191

expect(history).toHaveLength(1);

181192

expect(history[0]?.body).toContain("msg A");

@@ -203,7 +214,7 @@ describe("matrix group chat history — scenario 1: basic accumulation", () => {

203214

currentAgentId = "agent_a";

204215

await handler(DEFAULT_ROOM, makeRoomTriggerEvent({ eventId: "$b", body: "msg B", ts: 2000 }));

205216

{

206-

const ctx = finalizeInboundContext.mock.calls[0]?.[0] as Record<string, unknown>;

217+

const ctx = finalizeInboundContextCall(finalizeInboundContext, 0);

207218

const history = ctx["InboundHistory"] as Array<{ body: string }>;

208219

expect(history).toHaveLength(1);

209220

expect(history[0]?.body).toContain("msg A");

@@ -223,7 +234,7 @@ describe("matrix group chat history — scenario 1: basic accumulation", () => {

223234

currentAgentId = "agent_b";

224235

await handler(DEFAULT_ROOM, makeRoomTriggerEvent({ eventId: "$d", body: "msg D", ts: 4000 }));

225236

{

226-

const ctx = finalizeInboundContext.mock.calls[2]?.[0] as Record<string, unknown>;

237+

const ctx = finalizeInboundContextCall(finalizeInboundContext, 2);

227238

const history = ctx["InboundHistory"] as Array<unknown> | undefined;

228239

expect(history ?? []).toHaveLength(0);

229240

}

@@ -250,7 +261,7 @@ describe("matrix group chat history — scenario 1: basic accumulation", () => {

250261

}

251262252263

await handler(DEFAULT_ROOM, makeRoomTriggerEvent({ eventId: "$t", body: "trigger", ts: 5000 }));

253-

const ctx = finalizeInboundContext.mock.calls[0]?.[0] as Record<string, unknown>;

264+

const ctx = finalizeInboundContextCall(finalizeInboundContext, 0);

254265

const history = ctx["InboundHistory"] as Array<{ body: string }>;

255266

expect(history).toHaveLength(2);

256267

expect(history[0]?.body).toContain("pending 3");

@@ -273,7 +284,7 @@ describe("matrix group chat history — scenario 1: basic accumulation", () => {

273284

await handler(DEFAULT_ROOM, makeRoomPlainEvent({ eventId: "$p", body: "pending" }));

274285

await handler(DEFAULT_ROOM, makeRoomTriggerEvent({ eventId: "$t", body: "trigger" }));

275286276-

const ctx = finalizeInboundContext.mock.calls[0]?.[0] as Record<string, unknown>;

287+

const ctx = finalizeInboundContextCall(finalizeInboundContext, 0);

277288

const history = ctx["InboundHistory"] as Array<unknown> | undefined;

278289

expect(history ?? []).toHaveLength(0);

279290

});

@@ -545,7 +556,7 @@ describe("matrix group chat history — scenario 2: race condition safety", () =

545556

);

546557

expect(finalizeInboundContext).toHaveBeenCalledOnce();

547558

{

548-

const ctx = finalizeInboundContext.mock.calls[0]?.[0] as Record<string, unknown>;

559+

const ctx = finalizeInboundContextCall(finalizeInboundContext, 0);

549560

const history = ctx["InboundHistory"] as Array<{ body: string }>;

550561

expect(history).toHaveLength(1);

551562

expect(history[0]?.body).toContain("pending msg");

@@ -581,10 +592,10 @@ describe("matrix group chat history — scenario 2: race condition safety", () =

581592

);

582593583594

expect(finalizeInboundContext).toHaveBeenCalledTimes(2);

584-

const firstHistory = (finalizeInboundContext.mock.calls[0]?.[0] as Record<string, unknown>)[

595+

const firstHistory = finalizeInboundContextCall(finalizeInboundContext, 0)[

585596

"InboundHistory"

586597

] as Array<{ body: string }>;

587-

const retryHistory = (finalizeInboundContext.mock.calls[1]?.[0] as Record<string, unknown>)[

598+

const retryHistory = finalizeInboundContextCall(finalizeInboundContext, 1)[

588599

"InboundHistory"

589600

] as Array<{ body: string }>;

590601

@@ -683,7 +694,7 @@ describe("matrix group chat history — scenario 2: race condition safety", () =

683694

releaseFirstGetUserId?.();

684695

await Promise.all([plainPromise, triggerPromise]);

685696686-

const ctx = finalizeInboundContext.mock.calls[0]?.[0] as Record<string, unknown>;

697+

const ctx = finalizeInboundContextCall(finalizeInboundContext, 0);

687698

const history = ctx["InboundHistory"] as Array<{ body: string }>;

688699

expect(history.map((entry) => entry.body)).toEqual(["msg A"]);

689700

});