mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
docs(media): clarify legacy MEDIA line formatting (#96275)
* docs(media): clarify legacy MEDIA line formatting * docs(media): fix heading hierarchy * docs: update docs map for rich output protocol --------- Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
This commit is contained in:
@@ -9153,6 +9153,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
|
||||
- Route: /reference/rich-output-protocol
|
||||
- Headings:
|
||||
- H2: Media attachments
|
||||
- H2: Legacy MEDIA: lines
|
||||
- H2: `[embed ...]`
|
||||
- H2: Stored rendering shape
|
||||
- H2: Related
|
||||
|
||||
@@ -31,7 +31,34 @@ Do not emit text commands for attachments from tools, plugins, streaming blocks,
|
||||
Legacy final-reply text may still be normalized for compatibility, but this is not a general plugin/tool protocol.
|
||||
</Warning>
|
||||
|
||||
Plain Markdown image syntax (``) stays text by default. Channels that want Markdown images treated as media replies opt in at their outbound adapter; Telegram does this so `` becomes a media attachment.
|
||||
## Legacy `MEDIA:` lines
|
||||
|
||||
Legacy final assistant replies can still attach local media with a plain
|
||||
standalone `MEDIA:` line. The parser only recognizes lines whose trimmed text
|
||||
starts with `MEDIA:` outside Markdown wrappers and code fences.
|
||||
|
||||
Valid legacy final reply:
|
||||
|
||||
```text
|
||||
Here is the generated image.
|
||||
|
||||
MEDIA:/workspace/image.png
|
||||
```
|
||||
|
||||
These remain ordinary text and do not attach media:
|
||||
|
||||
```text
|
||||
**MEDIA:/workspace/image.png**
|
||||
`MEDIA:/workspace/image.png`
|
||||
Here is your image: MEDIA:/workspace/image.png
|
||||
```
|
||||
|
||||
Prefer structured `mediaUrl` / `mediaUrls` fields for tools, plugins, browser
|
||||
output, streaming blocks, and message actions.
|
||||
|
||||
Plain Markdown image syntax stays text by default. Channels that intentionally
|
||||
map Markdown image replies to media attachments opt in at their outbound
|
||||
adapter; Telegram does this so `` can still become a media reply.
|
||||
|
||||
When block streaming is enabled, media must ride on structured payload fields. If the same media URL appears in a streamed block and again in the final assistant payload, OpenClaw delivers it once and strips the duplicate from the final payload.
|
||||
|
||||
|
||||
@@ -212,6 +212,12 @@ Outbound attachments from the agent use structured media fields on the message t
|
||||
|
||||
OpenClaw sends structured media alongside the text. Legacy final assistant replies may still be normalized for compatibility, but tool output, browser output, streaming blocks, and message actions do not parse text as attachment commands.
|
||||
|
||||
If you must use a legacy final-reply `MEDIA:` line, keep it as standalone plain
|
||||
text. Markdown wrappers, code fences, and inline prose such as
|
||||
`**MEDIA:/path.png**`, `` `MEDIA:/path.png` ``, or
|
||||
`Here is the image: MEDIA:/path.png` stay text and do not attach media. See
|
||||
[Rich output protocol](/reference/rich-output-protocol#legacy-media-lines).
|
||||
|
||||
Local-path behavior follows the same file-read trust model as the agent:
|
||||
|
||||
- If `tools.fs.workspaceOnly` is `true`, outbound local media paths stay restricted to the OpenClaw temp root, the media cache, agent workspace paths, and sandbox-generated files.
|
||||
|
||||
Reference in New Issue
Block a user