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

推荐订阅源

Martin Fowler
Martin Fowler
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
博客园_首页
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
美团技术团队
IT之家
IT之家
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
博客园 - 叶小钗
M
MIT News - Artificial intelligence
B
Blog RSS Feed
有赞技术团队
有赞技术团队
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
Fix TTS supplement delivery across live previews (#82935)...
joshavant · 2026-05-17 · via Recent Commits to openclaw:main

@@ -1916,6 +1916,116 @@ describe("processDiscordMessage draft streaming", () => {

19161916

expect(deliverDiscordReply).toHaveBeenCalledTimes(1);

19171917

});

191819181919+

it("keeps the preview and sends media-only for TTS supplement finals", async () => {

1920+

const draftStream = createMockDraftStreamForTest();

1921+

dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => {

1922+

await params?.dispatcher.sendFinalReply({

1923+

mediaUrl: "https://example.com/tts.mp3",

1924+

audioAsVoice: true,

1925+

spokenText: "Spoken answer",

1926+

ttsSupplement: { spokenText: "Spoken answer" },

1927+

} as never);

1928+

return { queuedFinal: true, counts: { final: 1, tool: 0, block: 0 } };

1929+

});

1930+1931+

const ctx = await createAutomaticSourceDeliveryContext({

1932+

discordConfig: { streamMode: "partial", maxLinesPerMessage: 5 },

1933+

replyToMode: "first",

1934+

});

1935+1936+

await runProcessDiscordMessage(ctx);

1937+1938+

expect(draftStream.flush).toHaveBeenCalledTimes(1);

1939+

expect(draftStream.discardPending).not.toHaveBeenCalled();

1940+

expect(draftStream.clear).not.toHaveBeenCalled();

1941+

expectPreviewEditContent("Spoken answer");

1942+

expect(deliverDiscordReply).toHaveBeenCalledTimes(1);

1943+

expect(firstMockArg(deliverDiscordReply, "deliverDiscordReply")).toMatchObject({

1944+

replyToId: "m1",

1945+

replies: [

1946+

{

1947+

mediaUrl: "https://example.com/tts.mp3",

1948+

audioAsVoice: true,

1949+

spokenText: "Spoken answer",

1950+

ttsSupplement: { spokenText: "Spoken answer" },

1951+

},

1952+

],

1953+

});

1954+

});

1955+1956+

it("falls back with visible text when TTS supplement preview finalization fails", async () => {

1957+

const draftStream = createMockDraftStreamForTest();

1958+

editMessageDiscord.mockRejectedValueOnce(new Error("edit failed"));

1959+

dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => {

1960+

await params?.dispatcher.sendFinalReply({

1961+

mediaUrl: "https://example.com/tts.mp3",

1962+

audioAsVoice: true,

1963+

spokenText: "Spoken answer",

1964+

ttsSupplement: { spokenText: "Spoken answer" },

1965+

} as never);

1966+

return { queuedFinal: true, counts: { final: 1, tool: 0, block: 0 } };

1967+

});

1968+1969+

const ctx = await createAutomaticSourceDeliveryContext({

1970+

discordConfig: { streamMode: "partial", maxLinesPerMessage: 5 },

1971+

});

1972+1973+

await runProcessDiscordMessage(ctx);

1974+1975+

expect(draftStream.flush).toHaveBeenCalledTimes(1);

1976+

expect(draftStream.discardPending).toHaveBeenCalled();

1977+

expect(draftStream.clear).toHaveBeenCalled();

1978+

expect(deliverDiscordReply).toHaveBeenCalledTimes(1);

1979+

expect(firstMockArg(deliverDiscordReply, "deliverDiscordReply")).toMatchObject({

1980+

replies: [

1981+

{

1982+

text: "Spoken answer",

1983+

mediaUrl: "https://example.com/tts.mp3",

1984+

audioAsVoice: true,

1985+

spokenText: "Spoken answer",

1986+

ttsSupplement: { spokenText: "Spoken answer" },

1987+

},

1988+

],

1989+

});

1990+

});

1991+1992+

it("keeps already-delivered TTS supplement fallback audio-only", async () => {

1993+

editMessageDiscord.mockRejectedValueOnce(new Error("edit failed"));

1994+

dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => {

1995+

await params?.dispatcher.sendFinalReply({

1996+

mediaUrl: "https://example.com/tts.mp3",

1997+

audioAsVoice: true,

1998+

spokenText: "Spoken answer",

1999+

ttsSupplement: {

2000+

spokenText: "Spoken answer",

2001+

visibleTextAlreadyDelivered: true,

2002+

},

2003+

} as never);

2004+

return { queuedFinal: true, counts: { final: 1, tool: 0, block: 0 } };

2005+

});

2006+2007+

const ctx = await createAutomaticSourceDeliveryContext({

2008+

discordConfig: { streamMode: "partial", maxLinesPerMessage: 5 },

2009+

});

2010+2011+

await runProcessDiscordMessage(ctx);

2012+2013+

expect(deliverDiscordReply).toHaveBeenCalledTimes(1);

2014+

expect(firstMockArg(deliverDiscordReply, "deliverDiscordReply")).toMatchObject({

2015+

replies: [

2016+

{

2017+

mediaUrl: "https://example.com/tts.mp3",

2018+

audioAsVoice: true,

2019+

spokenText: "Spoken answer",

2020+

ttsSupplement: {

2021+

spokenText: "Spoken answer",

2022+

visibleTextAlreadyDelivered: true,

2023+

},

2024+

},

2025+

],

2026+

});

2027+

});

2028+19192029

it("does not flush draft previews for error finals before normal delivery", async () => {

19202030

const draftStream = createMockDraftStreamForTest();

19212031

dispatchInboundMessage.mockImplementationOnce(async (params?: DispatchInboundParams) => {