
























@@ -1,59 +1,51 @@
11---
2-summary: "Rich output shortcode protocol for embeds, media, audio hints, and replies"
2+summary: "Rich output protocol for structured media, embeds, audio hints, and replies"
33read_when:
44 - Changing assistant output rendering in the Control UI
5- - Debugging `[embed ...]`, `MEDIA:`, reply, or audio presentation directives
5+ - Debugging `[embed ...]`, structured media, reply, or audio presentation directives
66title: "Rich output protocol"
77---
8899Assistant output can carry a small set of delivery/render directives:
101011-- `MEDIA:` for attachment delivery
11+- structured `mediaUrl` / `mediaUrls` fields for attachment delivery
1212- `[[audio_as_voice]]` for audio presentation hints
1313- `[[reply_to_current]]` / `[[reply_to:<id>]]` for reply metadata
1414- `[embed ...]` for Control UI rich rendering
151516-Remote `MEDIA:` attachments must be public `https:` URLs. Plain `http:`,
16+Remote media attachments must be public `https:` URLs. Plain `http:`,
1717loopback, link-local, private, and internal hostnames are ignored as attachment
1818directives; server-side media fetchers still enforce their own network guards.
191920-Local `MEDIA:` attachments can use absolute paths, workspace-relative paths, or
20+Local media attachments can use absolute paths, workspace-relative paths, or
2121home-relative `~/` paths. They still pass through the agent file-read policy and
2222media type checks before delivery.
23232424<Warning>
25-`MEDIA:` is parsed only as plain text. Wrapping the directive in Markdown
26-formatting (bold, inline code, fenced code) prevents the parser from
27-recognizing it, and the attachment is silently dropped from delivery.
25+Do not emit text commands for attachments from tools, plugins, streaming blocks,
26+browser output, or message actions. Use structured media fields instead.
282729-Valid:
28+Valid message-tool payload:
302931-```text
32-MEDIA:/workspace/image.png
33-```
34-35-Invalid (parsed as prose, no attachment delivered):
36-37-```text
38-**MEDIA:/workspace/image.png**
39-`MEDIA:/workspace/image.png`
40-Here is your image: MEDIA:/workspace/image.png
30+```json
31+{ "message": "Here is your image.", "mediaUrl": "/workspace/image.png" }
4132```
423343-Keep `MEDIA:` on its own line, in plain text, with no surrounding formatting.
34+Legacy final assistant reply text may still be normalized for compatibility, but
35+it is not a general plugin/tool protocol.
4436</Warning>
45374638Plain Markdown image syntax stays text by default. Channels that intentionally
4739map Markdown image replies to media attachments opt in at their outbound
4840adapter; Telegram does this so `` can still become a media reply.
494150-These directives are separate. `MEDIA:` and reply/voice tags remain delivery metadata; `[embed ...]` is the web-only rich render path.
51-Trusted tool-result media uses the same `MEDIA:` / `[[audio_as_voice]]` parser before delivery, so text tool outputs can still mark an audio attachment as a voice note.
42+These directives are separate. Structured media fields and reply/voice tags are
43+delivery metadata; `[embed ...]` is the web-only rich render path.
524453-When block streaming is enabled, `MEDIA:` remains single-delivery metadata for a
54-turn. If the same media URL is sent in a streamed block and repeated in the final
55-assistant payload, OpenClaw delivers the attachment once and strips the duplicate
56-from the final payload.
45+When block streaming is enabled, media must be carried on structured payload
46+fields. If the same media URL is sent in a streamed block and repeated in the
47+final assistant payload, OpenClaw delivers the attachment once and strips the
48+duplicate from the final payload.
57495850## `[embed ...]`
5951@@ -72,7 +64,7 @@ Rules:
7264- Only URL-backed embeds are rendered. Use `ref="..."` or `url="..."`.
7365- Block-form inline HTML embed shortcodes are not rendered.
7466- The web UI strips the shortcode from visible text and renders the embed inline.
75-- `MEDIA:` is not an embed alias and should not be used for rich embed rendering.
67+- Structured media is not an embed alias and should not be used for rich embed rendering.
76687769## Stored rendering shape
7870此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。