AstrBot-Desktop/crates
YokiiroBW 5c064acf6c
一些检测仍在等待运行
ci / Portable quality checks (push) Waiting to run
ci / Windows Tauri build (push) Waiting to run
fix(astrbot): fetch attachments the way AstrBot addresses them
Reading the dashboard's own bundle settled where the file endpoints
are. It exposes upload as POST /api/v1/files, fetch-by-name as
GET /api/v1/files/content?filename=, and fetch-by-id as
GET /api/v1/files/{id}/content, and it fetches a chat image by name.

Both of our endpoints were wrong in different ways. Upload posted to
/api/v1/file, singular. Download used the by-id form with the id from
the attachment_saved frame, which does not address the file — asking for
it returned the dashboard's HTML shell with HTTP 200, which is what
surfaced as a broken image.

The name was there all along: the media frame carries [IMAGE]{uuid}.jpg
and the mapper discarded it, waiting for the id in the frame after.
Emit the marker from the media frame instead, naming the file, and keep
the saved id as a fallback for a media frame that names nothing usable.
A reference carrying a path or a scheme is refused rather than guessed
at, since the by-name fetch cannot express either.

Refs: N-6.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 02:53:43 +08:00
..
desktop-protocol fix(astrbot): fetch attachments the way AstrBot addresses them 2026-07-27 02:53:43 +08:00
mock-gateway test(p00): add frontend browser rust and windows checks 2026-07-18 20:42:40 +08:00