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

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园 - 聂微东
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
The GitHub Blog
The GitHub Blog
博客园_首页
博客园 - 叶小钗
腾讯CDC
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
宝玉的分享
宝玉的分享
D
Docker

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): preserve legacy tool voice hints · openclaw/ope...
steipete · 2026-04-26 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -25,6 +25,9 @@ Docs: https://docs.openclaw.ai

2525
2626

### Fixes

2727
28+

- Agents/TTS: preserve legacy `[[audio_as_voice]]` hints on trusted tool-result

29+

`MEDIA:` payloads so generated audio still delivers as a voice note. (#46535)

30+

Thanks @azade-c.

2831

- Telegram/STT: frame inbound voice-note transcripts as machine-generated,

2932

untrusted text in agent context while preserving raw transcript mention

3033

detection. Closes #33360. Thanks @smartchainark.

Original file line numberDiff line numberDiff line change

@@ -14,6 +14,7 @@ Assistant output can carry a small set of delivery/render directives:

1414

- `[embed ...]` for Control UI rich rendering

1515
1616

These directives are separate. `MEDIA:` and reply/voice tags remain delivery metadata; `[embed ...]` is the web-only rich render path.

17+

Trusted tool-result media uses the same `MEDIA:` / `[[audio_as_voice]]` parser before delivery, so legacy tool outputs can still mark an audio attachment as a voice note.

1718
1819

When block streaming is enabled, `MEDIA:` remains single-delivery metadata for a

1920

turn. If the same media URL is sent in a streamed block and repeated in the final

Original file line numberDiff line numberDiff line change

@@ -165,6 +165,34 @@ describe("handleToolExecutionEnd media emission", () => {

165165

expect(ctx.state.pendingToolMediaUrls).toEqual(["/tmp/screenshot.png"]);

166166

});

167167
168+

it("preserves legacy audio_as_voice when queuing trusted MEDIA tool output", async () => {

169+

const onToolResult = vi.fn();

170+

const ctx = createMockContext({

171+

shouldEmitToolOutput: false,

172+

onToolResult,

173+

builtinToolNames: new Set(["tts"]),

174+

});

175+
176+

await handleToolExecutionEnd(ctx, {

177+

type: "tool_execution_end",

178+

toolName: "tts",

179+

toolCallId: "tc-1",

180+

isError: false,

181+

result: {

182+

content: [

183+

{

184+

type: "text",

185+

text: "Generated audio reply.\n[[audio_as_voice]]\nMEDIA:/tmp/reply.opus",

186+

},

187+

],

188+

},

189+

});

190+
191+

expect(onToolResult).not.toHaveBeenCalled();

192+

expect(ctx.state.pendingToolMediaUrls).toEqual(["/tmp/reply.opus"]);

193+

expect(ctx.state.pendingToolAudioAsVoice).toBe(true);

194+

});

195+
168196

it("does NOT emit local media for untrusted tools", async () => {

169197

const onToolResult = vi.fn();

170198

const ctx = createMockContext({ shouldEmitToolOutput: false, onToolResult });

Original file line numberDiff line numberDiff line change

@@ -51,6 +51,33 @@ describe("extractToolResultMediaPaths", () => {

5151

});

5252

});

5353
54+

it("extracts audioAsVoice from legacy MEDIA text", () => {

55+

expect(

56+

extractToolResultMediaArtifact({

57+

content: [

58+

{ type: "text", text: "Generated audio\n[[audio_as_voice]]\nMEDIA:/tmp/reply.opus" },

59+

],

60+

}),

61+

).toEqual({

62+

mediaUrls: ["/tmp/reply.opus"],

63+

audioAsVoice: true,

64+

});

65+

});

66+
67+

it("keeps legacy audioAsVoice when the tag and MEDIA path are in separate text blocks", () => {

68+

expect(

69+

extractToolResultMediaArtifact({

70+

content: [

71+

{ type: "text", text: "[[audio_as_voice]]" },

72+

{ type: "text", text: "MEDIA:/tmp/reply.opus" },

73+

],

74+

}),

75+

).toEqual({

76+

mediaUrls: ["/tmp/reply.opus"],

77+

audioAsVoice: true,

78+

});

79+

});

80+
5481

it("extracts structured media trust markers", () => {

5582

expect(

5683

extractToolResultMediaArtifact({

Original file line numberDiff line numberDiff line change

@@ -307,6 +307,7 @@ export function extractToolResultMediaArtifact(

307307

// parser so directive matching and validation stay in sync with outbound

308308

// reply parsing.

309309

const paths: string[] = [];

310+

let audioAsVoice = false;

310311

let hasImageContent = false;

311312

for (const item of content) {

312313

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

@@ -319,14 +320,20 @@ export function extractToolResultMediaArtifact(

319320

}

320321

if (entry.type === "text" && typeof entry.text === "string") {

321322

const parsed = splitMediaFromOutput(entry.text);

323+

if (parsed.audioAsVoice) {

324+

audioAsVoice = true;

325+

}

322326

if (parsed.mediaUrls?.length) {

323327

paths.push(...parsed.mediaUrls);

324328

}

325329

}

326330

}

327331
328332

if (paths.length > 0) {

329-

return { mediaUrls: paths };

333+

return {

334+

mediaUrls: paths,

335+

...(audioAsVoice ? { audioAsVoice: true } : {}),

336+

};

330337

}

331338
332339

// Fall back to legacy details.path when image content exists but no