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

推荐订阅源

Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
S
Securelist
The Hacker News
The Hacker News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Fortinet All Blogs
Jina AI
Jina AI
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
Webroot Blog
Webroot Blog
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss
量子位
S
Schneier on Security
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
O
OpenAI News
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
博客园 - 叶小钗
L
LINUX DO - 最新话题
V
Visual Studio Blog
U
Unit 42
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Security Affairs
AWS News Blog
AWS News Blog
S
Secure Thoughts
腾讯CDC
Cloudbric
Cloudbric
H
Help Net Security
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
C
Cyber Attacks, Cyber Crime and Cyber Security
WordPress大学
WordPress大学
The Last Watchdog
The Last Watchdog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 【当耐特】
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
D
DataBreaches.Net
A
About on SuperTechFans
G
GRAHAM CLULEY
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Martin Fowler
Martin Fowler
Vercel News
Vercel News
Cisco Talos Blog
Cisco Talos Blog
NISL@THU
NISL@THU
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary

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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: tighten outbound hook error assertions · openclaw/openclaw@fa2ffa6
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -243,23 +243,6 @@ async function runBestEffortPartialFailureDelivery(params?: { onError?: boolean

243243

return { sendMatrix, onError, results };

244244

}

245245246-

function expectSuccessfulMatrixInternalHookPayload(

247-

expected: Partial<{

248-

content: string;

249-

messageId: string;

250-

isGroup: boolean;

251-

groupId: string;

252-

}>,

253-

) {

254-

return expect.objectContaining({

255-

to: "!room:example",

256-

success: true,

257-

channelId: "matrix",

258-

conversationId: "!room:example",

259-

...expected,

260-

});

261-

}

262-263246

describe("deliverOutboundPayloads", () => {

264247

beforeAll(async () => {

265248

({

@@ -2221,17 +2204,34 @@ describe("deliverOutboundPayloads", () => {

22212204

expect(sendMatrix).toHaveBeenCalledTimes(2);

2222220522232206

expect(internalHookMocks.createInternalHookEvent).toHaveBeenCalledTimes(1);

2224-

expect(internalHookMocks.createInternalHookEvent).toHaveBeenCalledWith(

2225-

"message",

2226-

"sent",

2227-

"agent:main:main",

2228-

expectSuccessfulMatrixInternalHookPayload({

2229-

content: "abcd",

2230-

messageId: "m2",

2231-

isGroup: true,

2232-

groupId: "matrix:room:123",

2233-

}),

2234-

);

2207+

const createHookCall = internalHookMocks.createInternalHookEvent.mock.calls[0] as

2208+

| [

2209+

unknown,

2210+

unknown,

2211+

unknown,

2212+

{

2213+

channelId?: unknown;

2214+

content?: unknown;

2215+

conversationId?: unknown;

2216+

groupId?: unknown;

2217+

isGroup?: unknown;

2218+

messageId?: unknown;

2219+

success?: unknown;

2220+

to?: unknown;

2221+

},

2222+

]

2223+

| undefined;

2224+

expect(createHookCall?.[0]).toBe("message");

2225+

expect(createHookCall?.[1]).toBe("sent");

2226+

expect(createHookCall?.[2]).toBe("agent:main:main");

2227+

expect(createHookCall?.[3]?.to).toBe("!room:example");

2228+

expect(createHookCall?.[3]?.success).toBe(true);

2229+

expect(createHookCall?.[3]?.channelId).toBe("matrix");

2230+

expect(createHookCall?.[3]?.conversationId).toBe("!room:example");

2231+

expect(createHookCall?.[3]?.content).toBe("abcd");

2232+

expect(createHookCall?.[3]?.messageId).toBe("m2");

2233+

expect(createHookCall?.[3]?.isGroup).toBe(true);

2234+

expect(createHookCall?.[3]?.groupId).toBe("matrix:room:123");

22352235

expect(internalHookMocks.triggerInternalHook).toHaveBeenCalledTimes(1);

22362236

});

22372237

@@ -2246,12 +2246,30 @@ describe("deliverOutboundPayloads", () => {

22462246

await deliverSingleMatrixForHookTest({ sessionKey: "agent:main:main" });

2247224722482248

expect(internalHookMocks.createInternalHookEvent).toHaveBeenCalledTimes(1);

2249-

expect(internalHookMocks.createInternalHookEvent).toHaveBeenCalledWith(

2250-

"message",

2251-

"sent",

2252-

"agent:main:main",

2253-

expectSuccessfulMatrixInternalHookPayload({ content: "hello", messageId: "m1" }),

2254-

);

2249+

const createHookCall = internalHookMocks.createInternalHookEvent.mock.calls[0] as

2250+

| [

2251+

unknown,

2252+

unknown,

2253+

unknown,

2254+

{

2255+

channelId?: unknown;

2256+

content?: unknown;

2257+

conversationId?: unknown;

2258+

messageId?: unknown;

2259+

success?: unknown;

2260+

to?: unknown;

2261+

},

2262+

]

2263+

| undefined;

2264+

expect(createHookCall?.[0]).toBe("message");

2265+

expect(createHookCall?.[1]).toBe("sent");

2266+

expect(createHookCall?.[2]).toBe("agent:main:main");

2267+

expect(createHookCall?.[3]?.to).toBe("!room:example");

2268+

expect(createHookCall?.[3]?.success).toBe(true);

2269+

expect(createHookCall?.[3]?.channelId).toBe("matrix");

2270+

expect(createHookCall?.[3]?.conversationId).toBe("!room:example");

2271+

expect(createHookCall?.[3]?.content).toBe("hello");

2272+

expect(createHookCall?.[3]?.messageId).toBe("m1");

22552273

expect(internalHookMocks.triggerInternalHook).toHaveBeenCalledTimes(1);

22562274

});

22572275

@@ -2559,10 +2577,12 @@ describe("deliverOutboundPayloads", () => {

25592577

});

2560257825612579

expect(onError).toHaveBeenCalledTimes(1);

2562-

expect(onError).toHaveBeenCalledWith(

2563-

expect.any(Error),

2564-

expect.objectContaining({ text: "hi", mediaUrls: ["https://x.test/a.jpg"] }),

2565-

);

2580+

const [error, failedPayload] = onError.mock.calls[0] ?? [];

2581+

expect(error).toBeInstanceOf(Error);

2582+

expect((failedPayload as { text?: unknown } | undefined)?.text).toBe("hi");

2583+

expect((failedPayload as { mediaUrls?: unknown } | undefined)?.mediaUrls).toStrictEqual([

2584+

"https://x.test/a.jpg",

2585+

]);

25662586

});

2567258725682588

it("mirrors delivered output when mirror options are provided", async () => {

@@ -2598,13 +2618,14 @@ describe("deliverOutboundPayloads", () => {

25982618

},

25992619

});

260026202601-

expect(mocks.appendAssistantMessageToSessionTranscript).toHaveBeenCalledWith(

2602-

expect.objectContaining({

2603-

text: "report.pdf",

2604-

idempotencyKey: "idem-deliver-1",

2605-

config: cfg,

2606-

}),

2607-

);

2621+

const appendOptions = (

2622+

mocks.appendAssistantMessageToSessionTranscript.mock.calls as unknown as Array<

2623+

[{ config?: unknown; idempotencyKey?: unknown; text?: unknown }]

2624+

>

2625+

)[0]?.[0];

2626+

expect(appendOptions?.text).toBe("report.pdf");

2627+

expect(appendOptions?.idempotencyKey).toBe("idem-deliver-1");

2628+

expect(appendOptions?.config).toBe(cfg);

26082629

});

2609263026102631

it("emits message_sent success for text-only deliveries", async () => {

@@ -2619,10 +2640,13 @@ describe("deliverOutboundPayloads", () => {

26192640

deps: { matrix: sendMatrix },

26202641

});

262126422622-

expect(hookMocks.runner.runMessageSent).toHaveBeenCalledWith(

2623-

expect.objectContaining({ to: "!room:example", content: "hello", success: true }),

2624-

expect.objectContaining({ channelId: "matrix" }),

2625-

);

2643+

const sentCall = hookMocks.runner.runMessageSent.mock.calls[0] as

2644+

| [{ content?: unknown; success?: unknown; to?: unknown }, { channelId?: unknown }]

2645+

| undefined;

2646+

expect(sentCall?.[0]?.to).toBe("!room:example");

2647+

expect(sentCall?.[0]?.content).toBe("hello");

2648+

expect(sentCall?.[0]?.success).toBe(true);

2649+

expect(sentCall?.[1]?.channelId).toBe("matrix");

26262650

});

2627265126282652

it("short-circuits lower-priority message_sending hooks after cancel=true", async () => {

@@ -2691,7 +2715,7 @@ describe("deliverOutboundPayloads", () => {

26912715

});

2692271626932717

expect(results).toEqual([{ channel: "matrix", messageId: "mx-1" }]);

2694-

expect(sendText).toHaveBeenCalledWith(expect.objectContaining({ text: "provider exploded" }));

2718+

expect(sendText.mock.calls[0]?.[0]?.text).toBe("provider exploded");

26952719

expect(sendPayload).not.toHaveBeenCalled();

26962720

});

26972721

@@ -2724,12 +2748,12 @@ describe("deliverOutboundPayloads", () => {

27242748

});

2725274927262750

expect(results).toEqual([{ channel: "matrix", messageId: "mx-1" }]);

2727-

expect(sendPayload).toHaveBeenCalledWith(

2728-

expect.objectContaining({

2729-

text: "provider exploded",

2730-

payload: expect.objectContaining({ text: "provider exploded", isError: true }),

2731-

}),

2732-

);

2751+

const sendPayloadOptions = sendPayload.mock.calls[0]?.[0] as

2752+

| { payload?: { isError?: unknown; text?: unknown }; text?: unknown }

2753+

| undefined;

2754+

expect(sendPayloadOptions?.text).toBe("provider exploded");

2755+

expect(sendPayloadOptions?.payload?.text).toBe("provider exploded");

2756+

expect(sendPayloadOptions?.payload?.isError).toBe(true);

27332757

expect(sendText).not.toHaveBeenCalled();

27342758

});

27352759

@@ -2799,10 +2823,13 @@ describe("deliverOutboundPayloads", () => {

27992823

payloads: [{ text: "payload text", channelData: { mode: "custom" } }],

28002824

});

280128252802-

expect(hookMocks.runner.runMessageSent).toHaveBeenCalledWith(

2803-

expect.objectContaining({ to: "!room:1", content: "payload text", success: true }),

2804-

expect.objectContaining({ channelId: "matrix" }),

2805-

);

2826+

const sentCall = hookMocks.runner.runMessageSent.mock.calls[0] as

2827+

| [{ content?: unknown; success?: unknown; to?: unknown }, { channelId?: unknown }]

2828+

| undefined;

2829+

expect(sentCall?.[0]?.to).toBe("!room:1");

2830+

expect(sentCall?.[0]?.content).toBe("payload text");

2831+

expect(sentCall?.[0]?.success).toBe(true);

2832+

expect(sentCall?.[1]?.channelId).toBe("matrix");

28062833

});

2807283428082835

it("does not fail successful sends when optional delivery pinning fails", async () => {

@@ -2830,14 +2857,15 @@ describe("deliverOutboundPayloads", () => {

2830285728312858

expect(results).toEqual([{ channel: "matrix", messageId: "mx-1" }]);

28322859

expect(pinDeliveredMessage).toHaveBeenCalledTimes(1);

2833-

expect(logMocks.warn).toHaveBeenCalledWith(

2860+

expect(logMocks.warn.mock.calls[0]?.[0]).toBe(

28342861

"Delivery pin requested, but channel failed to pin delivered message.",

2835-

expect.objectContaining({

2836-

channel: "matrix",

2837-

messageId: "mx-1",

2838-

error: "pin denied",

2839-

}),

28402862

);

2863+

const warnContext = logMocks.warn.mock.calls[0]?.[1] as

2864+

| { channel?: unknown; error?: unknown; messageId?: unknown }

2865+

| undefined;

2866+

expect(warnContext?.channel).toBe("matrix");

2867+

expect(warnContext?.messageId).toBe("mx-1");

2868+

expect(warnContext?.error).toBe("pin denied");

28412869

});

2842287028432871

it("fails sends when required delivery pinning fails", async () => {

@@ -2900,9 +2928,10 @@ describe("deliverOutboundPayloads", () => {

29002928

});

2901292929022930

expect(sendText).toHaveBeenCalledTimes(2);

2903-

expect(pinDeliveredMessage).toHaveBeenCalledWith(

2904-

expect.objectContaining({ messageId: "mx-1" }),

2905-

);

2931+

const pinOptions = (

2932+

pinDeliveredMessage.mock.calls as unknown as Array<[{ messageId?: unknown }]>

2933+

)[0]?.[0];

2934+

expect(pinOptions?.messageId).toBe("mx-1");

29062935

});

2907293629082937

it("pins the first delivered media message for multi-media payloads", async () => {

@@ -2939,9 +2968,10 @@ describe("deliverOutboundPayloads", () => {

29392968

});

2940296929412970

expect(sendMedia).toHaveBeenCalledTimes(2);

2942-

expect(pinDeliveredMessage).toHaveBeenCalledWith(

2943-

expect.objectContaining({ messageId: "mx-1" }),

2944-

);

2971+

const pinOptions = (

2972+

pinDeliveredMessage.mock.calls as unknown as Array<[{ messageId?: unknown }]>

2973+

)[0]?.[0];

2974+

expect(pinOptions?.messageId).toBe("mx-1");

29452975

});

2946297629472977

it("preserves channelData-only payloads with empty text for sendPayload channels", async () => {

@@ -2969,11 +2999,11 @@ describe("deliverOutboundPayloads", () => {

29692999

});

2970300029713001

expect(sendPayload).toHaveBeenCalledTimes(1);

2972-

expect(sendPayload).toHaveBeenCalledWith(

2973-

expect.objectContaining({

2974-

payload: expect.objectContaining({ text: "", channelData: { mode: "flex" } }),

2975-

}),

2976-

);

3002+

const sendPayloadOptions = sendPayload.mock.calls[0]?.[0] as

3003+

| { payload?: { channelData?: unknown; text?: unknown } }

3004+

| undefined;

3005+

expect(sendPayloadOptions?.payload?.text).toBe("");

3006+

expect(sendPayloadOptions?.payload?.channelData).toStrictEqual({ mode: "flex" });

29773007

expect(results).toEqual([{ channel: "line", messageId: "ln-1" }]);

29783008

});

29793009

@@ -3000,18 +3030,15 @@ describe("deliverOutboundPayloads", () => {

30003030

});

3001303130023032

expect(sendText).toHaveBeenCalledTimes(1);

3003-

expect(sendText).toHaveBeenCalledWith(

3004-

expect.objectContaining({

3005-

text: "caption",

3006-

}),

3007-

);

3008-

expect(logMocks.warn).toHaveBeenCalledWith(

3033+

expect(sendText.mock.calls[0]?.[0]?.text).toBe("caption");

3034+

expect(logMocks.warn.mock.calls[0]?.[0]).toBe(

30093035

"Plugin outbound adapter does not implement sendMedia; media URLs will be dropped and text fallback will be used",

3010-

expect.objectContaining({

3011-

channel: "matrix",

3012-

mediaCount: 1,

3013-

}),

30143036

);

3037+

const warnContext = logMocks.warn.mock.calls[0]?.[1] as

3038+

| { channel?: unknown; mediaCount?: unknown }

3039+

| undefined;

3040+

expect(warnContext?.channel).toBe("matrix");

3041+

expect(warnContext?.mediaCount).toBe(1);

30153042

expect(results).toEqual([{ channel: "matrix", messageId: "mx-1" }]);

30163043

});

30173044

@@ -3043,18 +3070,15 @@ describe("deliverOutboundPayloads", () => {

30433070

});

3044307130453072

expect(sendText).toHaveBeenCalledTimes(1);

3046-

expect(sendText).toHaveBeenCalledWith(

3047-

expect.objectContaining({

3048-

text: "caption",

3049-

}),

3050-

);

3051-

expect(logMocks.warn).toHaveBeenCalledWith(

3073+

expect(sendText.mock.calls[0]?.[0]?.text).toBe("caption");

3074+

expect(logMocks.warn.mock.calls[0]?.[0]).toBe(

30523075

"Plugin outbound adapter does not implement sendMedia; media URLs will be dropped and text fallback will be used",

3053-

expect.objectContaining({

3054-

channel: "matrix",

3055-

mediaCount: 2,

3056-

}),

30573076

);

3077+

const warnContext = logMocks.warn.mock.calls[0]?.[1] as

3078+

| { channel?: unknown; mediaCount?: unknown }

3079+

| undefined;

3080+

expect(warnContext?.channel).toBe("matrix");

3081+

expect(warnContext?.mediaCount).toBe(2);

30583082

expect(results).toEqual([{ channel: "matrix", messageId: "mx-2" }]);

30593083

});

30603084

@@ -3086,23 +3110,27 @@ describe("deliverOutboundPayloads", () => {

30863110

);

3087311130883112

expect(sendText).not.toHaveBeenCalled();

3089-

expect(logMocks.warn).toHaveBeenCalledWith(

3113+

expect(logMocks.warn.mock.calls[0]?.[0]).toBe(

30903114

"Plugin outbound adapter does not implement sendMedia; media URLs will be dropped and text fallback will be used",

3091-

expect.objectContaining({

3092-

channel: "matrix",

3093-

mediaCount: 1,

3094-

}),

30953115

);

3096-

expect(hookMocks.runner.runMessageSent).toHaveBeenCalledWith(

3097-

expect.objectContaining({

3098-

to: "!room:1",

3099-

content: "",

3100-

success: false,

3101-

error:

3102-

"Plugin outbound adapter does not implement sendMedia and no text fallback is available for media payload",

3103-

}),

3104-

expect.objectContaining({ channelId: "matrix" }),

3116+

const warnContext = logMocks.warn.mock.calls[0]?.[1] as

3117+

| { channel?: unknown; mediaCount?: unknown }

3118+

| undefined;

3119+

expect(warnContext?.channel).toBe("matrix");

3120+

expect(warnContext?.mediaCount).toBe(1);

3121+

const sentCall = hookMocks.runner.runMessageSent.mock.calls[0] as

3122+

| [

3123+

{ content?: unknown; error?: unknown; success?: unknown; to?: unknown },

3124+

{ channelId?: unknown },

3125+

]

3126+

| undefined;

3127+

expect(sentCall?.[0]?.to).toBe("!room:1");

3128+

expect(sentCall?.[0]?.content).toBe("");

3129+

expect(sentCall?.[0]?.success).toBe(false);

3130+

expect(sentCall?.[0]?.error).toBe(

3131+

"Plugin outbound adapter does not implement sendMedia and no text fallback is available for media payload",

31053132

);

3133+

expect(sentCall?.[1]?.channelId).toBe("matrix");

31063134

});

3107313531083136

it("emits message_sent failure when delivery errors", async () => {

@@ -3119,15 +3147,17 @@ describe("deliverOutboundPayloads", () => {

31193147

}),

31203148

).rejects.toThrow("downstream failed");

312131493122-

expect(hookMocks.runner.runMessageSent).toHaveBeenCalledWith(

3123-

expect.objectContaining({

3124-

to: "!room:example",

3125-

content: "hi",

3126-

success: false,

3127-

error: "downstream failed",

3128-

}),

3129-

expect.objectContaining({ channelId: "matrix" }),

3130-

);

3150+

const sentCall = hookMocks.runner.runMessageSent.mock.calls[0] as

3151+

| [

3152+

{ content?: unknown; error?: unknown; success?: unknown; to?: unknown },

3153+

{ channelId?: unknown },

3154+

]

3155+

| undefined;

3156+

expect(sentCall?.[0]?.to).toBe("!room:example");

3157+

expect(sentCall?.[0]?.content).toBe("hi");

3158+

expect(sentCall?.[0]?.success).toBe(false);

3159+

expect(sentCall?.[0]?.error).toBe("downstream failed");

3160+

expect(sentCall?.[1]?.channelId).toBe("matrix");

31313161

});

31323162

});

31333163