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

推荐订阅源

小众软件
小众软件
WordPress大学
WordPress大学
IT之家
IT之家
G
Google Developers Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler
V
V2EX
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
V
Visual Studio Blog
有赞技术团队
有赞技术团队
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 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 outbound media delivery assertions · opencl...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -1699,13 +1699,12 @@ describe("deliverOutboundPayloads", () => {

16991699

});

1700170017011701

expect(sendFormattedText).toHaveBeenCalledTimes(1);

1702-

expect(sendFormattedText).toHaveBeenCalledWith(

1703-

expect.objectContaining({

1704-

to: "U123",

1705-

text: "hello **boss**",

1706-

accountId: "default",

1707-

}),

1708-

);

1702+

const formattedTextOptions = sendFormattedText.mock.calls[0]?.[0] as

1703+

| { accountId?: unknown; text?: unknown; to?: unknown }

1704+

| undefined;

1705+

expect(formattedTextOptions?.to).toBe("U123");

1706+

expect(formattedTextOptions?.text).toBe("hello **boss**");

1707+

expect(formattedTextOptions?.accountId).toBe("default");

17091708

expect(sendText).not.toHaveBeenCalled();

17101709

expect(textResults.map((entry) => entry.messageId)).toEqual([

17111710

"fmt:hello **boss**:1",

@@ -1722,17 +1721,13 @@ describe("deliverOutboundPayloads", () => {

17221721

});

1723172217241723

expect(sendFormattedMedia).toHaveBeenCalledTimes(1);

1725-

expect(sendFormattedMedia).toHaveBeenCalledWith(

1726-

expect.objectContaining({

1727-

to: "U123",

1728-

text: "photo",

1729-

mediaUrl: "file:///tmp/f.png",

1730-

mediaLocalRoots: expect.arrayContaining([expectedPreferredTmpRoot]),

1731-

}),

1732-

);

17331724

const sendFormattedMediaCall = sendFormattedMedia.mock.calls[0]?.[0] as

1734-

| { mediaLocalRoots?: string[] }

1725+

| { mediaLocalRoots?: string[]; mediaUrl?: unknown; text?: unknown; to?: unknown }

17351726

| undefined;

1727+

expect(sendFormattedMediaCall?.to).toBe("U123");

1728+

expect(sendFormattedMediaCall?.text).toBe("photo");

1729+

expect(sendFormattedMediaCall?.mediaUrl).toBe("file:///tmp/f.png");

1730+

expect(sendFormattedMediaCall?.mediaLocalRoots).toContain(expectedPreferredTmpRoot);

17361731

expect(

17371732

sendFormattedMediaCall?.mediaLocalRoots?.some((root) =>

17381733

root.endsWith(path.join(".openclaw", "workspace-work")),

@@ -1752,13 +1747,12 @@ describe("deliverOutboundPayloads", () => {

17521747

deps: { matrix: sendMatrix },

17531748

});

175417491755-

expect(sendMatrix).toHaveBeenCalledWith(

1756-

"!room:example",

1757-

"hi",

1758-

expect.objectContaining({

1759-

mediaLocalRoots: expect.arrayContaining([expectedPreferredTmpRoot]),

1760-

}),

1761-

);

1750+

expect(sendMatrix.mock.calls[0]?.[0]).toBe("!room:example");

1751+

expect(sendMatrix.mock.calls[0]?.[1]).toBe("hi");

1752+

const sendMatrixOptions = sendMatrix.mock.calls[0]?.[2] as

1753+

| { mediaLocalRoots?: string[] }

1754+

| undefined;

1755+

expect(sendMatrixOptions?.mediaLocalRoots).toContain(expectedPreferredTmpRoot);

17621756

});

1763175717641758

it("sends plugin media to an explicit target once instead of fanning out over allowFrom", async () => {

@@ -1795,14 +1789,23 @@ describe("deliverOutboundPayloads", () => {

17951789

});

1796179017971791

expect(sendMedia).toHaveBeenCalledTimes(1);

1798-

expect(sendMedia).toHaveBeenCalledWith(

1799-

expect.objectContaining({

1800-

to: "!explicit:example",

1801-

text: "HEARTBEAT_OK",

1802-

mediaUrl: "https://example.com/img.png",

1803-

accountId: undefined,

1804-

}),

1805-

);

1792+

const sendMediaOptions = (

1793+

sendMedia.mock.calls as Array<

1794+

[

1795+

{

1796+

accountId?: unknown;

1797+

audioAsVoice?: unknown;

1798+

mediaUrl?: unknown;

1799+

text?: unknown;

1800+

to?: unknown;

1801+

},

1802+

]

1803+

>

1804+

)[0]?.[0];

1805+

expect(sendMediaOptions?.to).toBe("!explicit:example");

1806+

expect(sendMediaOptions?.text).toBe("HEARTBEAT_OK");

1807+

expect(sendMediaOptions?.mediaUrl).toBe("https://example.com/img.png");

1808+

expect(sendMediaOptions?.accountId).toBeUndefined();

18061809

});

1807181018081811

it("forwards audioAsVoice through generic plugin media delivery", async () => {

@@ -1838,14 +1841,15 @@ describe("deliverOutboundPayloads", () => {

18381841

payloads: [{ text: "voice caption", mediaUrl: "file:///tmp/clip.mp3", audioAsVoice: true }],

18391842

});

184018431841-

expect(sendMedia).toHaveBeenCalledWith(

1842-

expect.objectContaining({

1843-

to: "room:!room:example",

1844-

text: "voice caption",

1845-

mediaUrl: "file:///tmp/clip.mp3",

1846-

audioAsVoice: true,

1847-

}),

1848-

);

1844+

const sendMediaOptions = (

1845+

sendMedia.mock.calls as unknown as Array<

1846+

[{ audioAsVoice?: unknown; mediaUrl?: unknown; text?: unknown; to?: unknown }]

1847+

>

1848+

)[0]?.[0];

1849+

expect(sendMediaOptions?.to).toBe("room:!room:example");

1850+

expect(sendMediaOptions?.text).toBe("voice caption");

1851+

expect(sendMediaOptions?.mediaUrl).toBe("file:///tmp/clip.mp3");

1852+

expect(sendMediaOptions?.audioAsVoice).toBe(true);

18491853

});

1850185418511855

it("exposes audio-only spokenText to hooks without rendering it as media caption", async () => {

@@ -1888,26 +1892,25 @@ describe("deliverOutboundPayloads", () => {

18881892

],

18891893

});

189018941891-

expect(hookMocks.runner.runMessageSending).toHaveBeenCalledWith(

1892-

expect.objectContaining({

1893-

content: "original hidden transcript",

1894-

}),

1895-

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

1896-

);

1897-

expect(sendMedia).toHaveBeenCalledWith(

1898-

expect.objectContaining({

1899-

text: "",

1900-

mediaUrl: "file:///tmp/clip.opus",

1901-

audioAsVoice: true,

1902-

}),

1903-

);

1904-

expect(hookMocks.runner.runMessageSent).toHaveBeenCalledWith(

1905-

expect.objectContaining({

1906-

content: "rewritten hidden transcript",

1907-

success: true,

1908-

}),

1909-

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

1910-

);

1895+

const sendingCall = hookMocks.runner.runMessageSending.mock.calls[0] as

1896+

| [{ content?: unknown }, { channelId?: unknown }]

1897+

| undefined;

1898+

expect(sendingCall?.[0]?.content).toBe("original hidden transcript");

1899+

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

1900+

const sendMediaOptions = (

1901+

sendMedia.mock.calls as unknown as Array<

1902+

[{ audioAsVoice?: unknown; mediaUrl?: unknown; text?: unknown }]

1903+

>

1904+

)[0]?.[0];

1905+

expect(sendMediaOptions?.text).toBe("");

1906+

expect(sendMediaOptions?.mediaUrl).toBe("file:///tmp/clip.opus");

1907+

expect(sendMediaOptions?.audioAsVoice).toBe(true);

1908+

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

1909+

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

1910+

| undefined;

1911+

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

1912+

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

1913+

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

19111914

});

1912191519131916

it("chunks plugin text and returns all results", async () => {