Normalize agent attachment output (#122)

This commit is contained in:
Eyejoker
2026-05-02 19:50:32 +09:00
committed by GitHub
parent 9e45534de0
commit d3c02265e5
16 changed files with 414 additions and 124 deletions

View File

@@ -7,22 +7,10 @@ When working as a sub-agent or teammate, only use `send_message` if the main age
## Image attachments
When a locally generated image or screenshot should appear in Discord, return an EJClaw structured output with `attachments` instead of only writing the file path in prose:
When a locally generated image or screenshot should appear in Discord, include a Markdown image with an absolute local path:
```json
{
"ejclaw": {
"visibility": "public",
"text": "스크린샷을 첨부했습니다.",
"attachments": [
{
"path": "/absolute/path/screenshot.png",
"name": "screenshot.png",
"mime": "image/png"
}
]
}
}
```text
![screenshot](/absolute/path/screenshot.png)
```
Use absolute local paths only, and do not repeat the same path in the visible text. Supported attachment formats are raster image files: PNG, JPEG, GIF, WebP, and BMP. SVG is not accepted.
You may also use `[Image: /absolute/path/screenshot.png]` when that is shorter. Use absolute local paths only, do not repeat the same path in the visible text, and only attach raster image files: PNG, JPEG, GIF, WebP, and BMP. SVG is not accepted.

View File

@@ -30,27 +30,15 @@ Your output is sent directly to the Discord group.
## Image attachments
When you need to show a locally generated image, screenshot, or other raster output in Discord, do not rely on a raw file path in prose. Emit an EJClaw structured output with `attachments`.
When you need to show a locally generated image, screenshot, or other raster output in Discord, include a Markdown image with an absolute local path:
```json
{
"ejclaw": {
"visibility": "public",
"text": "이미지를 생성했습니다.",
"verdict": "done",
"attachments": [
{
"path": "/absolute/path/image.png",
"name": "image.png",
"mime": "image/png"
}
]
}
}
```text
![image](/absolute/path/image.png)
```
- `attachments.path` must be an absolute local path; URLs and relative paths are ignored
- Do not repeat the same file path in the visible text
- You may also use `[Image: /absolute/path/image.png]` when that is shorter
- URLs and relative paths are ignored
- Do not repeat the same file path elsewhere in the visible text
- Supported attachment formats are raster image files: PNG, JPEG, GIF, WebP, and BMP. SVG is not accepted.
- Use this for generated images and e2e screenshots; the Discord channel validates and uploads the file

View File

@@ -22,30 +22,16 @@ The group folder may contain a `conversations/` directory with searchable histor
## Image attachments
For locally generated images or e2e screenshots that should appear in Discord, prefer EJClaw structured attachments over prose paths:
For locally generated images or e2e screenshots that should appear in Discord, include a Markdown image with an absolute local path:
```json
{
"ejclaw": {
"visibility": "public",
"text": "스크린샷을 첨부했습니다.",
"verdict": "done",
"attachments": [
{
"path": "/absolute/path/screenshot.png",
"name": "screenshot.png",
"mime": "image/png"
}
]
}
}
```text
![screenshot](/absolute/path/screenshot.png)
```
- When emitting this as your final runner output, emit the JSON envelope directly. Do not wrap it in Markdown fences or add prose outside the JSON.
- Use absolute local paths only
- Do not duplicate the same path in the visible text
- You may also use `[Image: /absolute/path/screenshot.png]` when that is shorter
- Do not duplicate the same path elsewhere in the visible text
- Supported attachment formats are raster image files: PNG, JPEG, GIF, WebP, and BMP. SVG is not accepted.
- The channel harness validates and uploads attachments; plain prose paths are not reliable
- The channel harness validates and uploads attachments from these image markers
## CI monitoring (watch_ci)