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

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
WordPress大学
WordPress大学
爱范儿
爱范儿
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
博客园_首页
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
MyScale Blog
MyScale Blog
IT之家
IT之家
H
Help Net Security
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Y
Y Combinator 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 gateway send media assertions · openclaw/op...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -179,19 +179,24 @@ async function runMessageActionRequest(

179179

return { respond };

180180

}

181181182+

function deliveryCall(index = 0): Record<string, any> | undefined {

183+

const calls = mocks.deliverOutboundPayloads.mock.calls as unknown as Array<[Record<string, any>]>;

184+

return calls[index]?.[0];

185+

}

186+187+

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

188+

const calls = respond.mock.calls as unknown as Array<

189+

[boolean, Record<string, any>, unknown, Record<string, any>]

190+

>;

191+

return calls[0];

192+

}

193+182194

function expectDeliverySessionMirror(params: { agentId: string; sessionKey: string }) {

183-

expect(mocks.deliverOutboundPayloads).toHaveBeenCalledWith(

184-

expect.objectContaining({

185-

session: expect.objectContaining({

186-

agentId: params.agentId,

187-

key: params.sessionKey,

188-

}),

189-

mirror: expect.objectContaining({

190-

sessionKey: params.sessionKey,

191-

agentId: params.agentId,

192-

}),

193-

}),

194-

);

195+

const call = deliveryCall();

196+

expect(call?.session?.agentId).toBe(params.agentId);

197+

expect(call?.session?.key).toBe(params.sessionKey);

198+

expect(call?.mirror?.sessionKey).toBe(params.sessionKey);

199+

expect(call?.mirror?.agentId).toBe(params.agentId);

195200

}

196201197202

function mockDeliverySuccess(messageId: string) {

@@ -241,17 +246,14 @@ describe("gateway send mirroring", () => {

241246

idempotencyKey: "idem-media-only",

242247

});

243248244-

expect(mocks.deliverOutboundPayloads).toHaveBeenCalledWith(

245-

expect.objectContaining({

246-

payloads: [{ text: "", mediaUrl: "https://example.com/a.png", mediaUrls: undefined }],

247-

}),

248-

);

249-

expect(respond).toHaveBeenCalledWith(

250-

true,

251-

expect.objectContaining({ messageId: "m-media" }),

252-

undefined,

253-

expect.objectContaining({ channel: "slack" }),

254-

);

249+

expect(deliveryCall()?.payloads).toEqual([

250+

{ text: "", mediaUrl: "https://example.com/a.png", mediaUrls: undefined },

251+

]);

252+

const response = firstRespondCall(respond);

253+

expect(response?.[0]).toBe(true);

254+

expect(response?.[1]?.messageId).toBe("m-media");

255+

expect(response?.[2]).toBeUndefined();

256+

expect(response?.[3]?.channel).toBe("slack");

255257

});

256258257259

it("passes outbound session context for gateway media sends", async () => {

@@ -266,22 +268,16 @@ describe("gateway send mirroring", () => {

266268

idempotencyKey: "idem-whatsapp-media",

267269

});

268270269-

expect(mocks.deliverOutboundPayloads).toHaveBeenCalledWith(

270-

expect.objectContaining({

271-

channel: "whatsapp",

272-

payloads: [

273-

{

274-

text: "caption",

275-

mediaUrl: "file:///tmp/workspace/photo.png",

276-

mediaUrls: undefined,

277-

},

278-

],

279-

session: expect.objectContaining({

280-

agentId: "work",

281-

key: "agent:work:whatsapp:resolved",

282-

}),

283-

}),

284-

);

271+

expect(deliveryCall()?.channel).toBe("whatsapp");

272+

expect(deliveryCall()?.payloads).toEqual([

273+

{

274+

text: "caption",

275+

mediaUrl: "file:///tmp/workspace/photo.png",

276+

mediaUrls: undefined,

277+

},

278+

]);

279+

expect(deliveryCall()?.session?.agentId).toBe("work");

280+

expect(deliveryCall()?.session?.key).toBe("agent:work:whatsapp:resolved");

285281

});

286282287283

it("maps gateway asVoice sends onto outbound audioAsVoice payloads", async () => {

@@ -296,23 +292,14 @@ describe("gateway send mirroring", () => {

296292

idempotencyKey: "idem-voice",

297293

});

298294299-

expect(mocks.deliverOutboundPayloads).toHaveBeenCalledWith(

300-

expect.objectContaining({

301-

payloads: [

302-

expect.objectContaining({

303-

text: "voice note",

304-

mediaUrl: "file:///tmp/openclaw-voice.ogg",

305-

audioAsVoice: true,

306-

}),

307-

],

308-

}),

309-

);

310-

expect(respond).toHaveBeenCalledWith(

311-

true,

312-

expect.objectContaining({ messageId: "m-voice" }),

313-

undefined,

314-

expect.objectContaining({ channel: "slack" }),

315-

);

295+

expect(deliveryCall()?.payloads?.[0]?.text).toBe("voice note");

296+

expect(deliveryCall()?.payloads?.[0]?.mediaUrl).toBe("file:///tmp/openclaw-voice.ogg");

297+

expect(deliveryCall()?.payloads?.[0]?.audioAsVoice).toBe(true);

298+

const response = firstRespondCall(respond);

299+

expect(response?.[0]).toBe(true);

300+

expect(response?.[1]?.messageId).toBe("m-voice");

301+

expect(response?.[2]).toBeUndefined();

302+

expect(response?.[3]?.channel).toBe("slack");

316303

});

317304318305

it("forwards gateway client scopes into outbound delivery", async () => {