Repository navigation
Desktop: image attachments re-encoded to webp in attachment store cause 400 'url' field must be a base64 encoded image with OpenAI-compatible local providers, and the poisoned image block stays in session history so later text-only messages also fail #8051
chironcheng
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug
Image attachments in the DSH desktop client are stored in webp format, so any
image the user attaches produces a webp data-url image block. OpenAI-compatible
local providers (tested: LM Studio) reject webp data-urls with
400 "'url' field must be a base64 encoded image.", so every message thatcontains such an attachment fails with
INVALID_REQUEST.Even worse: the bad image block remains in the session history, and each request
replays the whole history — so even subsequent text-only messages in the same
session keep returning 400 until the user starts a new session.
Environment
0.1.7-rc.2(Windows)http://<lan-ip>:1234/v1, LM Studio)qwen3.8-27b-nvfp4-mtp(vision-capable;input: [text, image])Reproduction
In a new DSH desktop session, attach a PNG image (1024x1024, ~330 KB).
Send any message — request fails with:
400 "'url' field must be a base64 encoded image."(code: INVALID_REQUEST)Observe the stored attachment object under
~/.dsh/attachments/v1/objects/...: the file is a webp (330476 bytes,1024x1024) although the attachment's
nameis still...png.In the same session, send a text-only message (e.g. "hello") — it fails
with the same 400, because the session history is replayed with the bad
attachment block included:
{"type":"image","attachment":{"attachmentId":"sha256:...","mediaType":"image/webp","width":1024,"height":1024,"bytes":330476,"name":"红军小战士.png"}}Evidence
attachment metadata says
.png; the image block sent to the providercarries
mediaType: image/webp.the provider returns 200 and the model correctly describes the image content
(
prompt_tokensincludes the image). Sending the webp data-url returns the400 above. So the provider accepts PNG/JPEG data-urls and rejects webp.
273b77bbtimeline (from~/.dsh/sessions/.../session.v4.jsonl.zstd):attachment block, so the whole session is unusable.
Impact
providers that only accept PNG/JPEG data-urls.
image-related error and has no way to know why.
pipeline (e.g. giving the agent a file path and letting it read the file
itself).
Suggestions
original format (or at least keep PNG/JPEG when the target provider is
OpenAI-compatible).
accepts, and surface the conversion to the user.
poison the session; consider dropping/repairing the block or clearly telling
the user which attachment broke the session.
Related
urlin image blocks ->400 Invalid url.) in CherryStudio's built-in gateway: [Bug] Agent mode image sending returns 400 "Invalid url." — Gateway Anthropic→OpenAI image conversion produces empty url CherryHQ/cherry-studio#21081. Different signature,
likely different code path, but the same user-visible failure class (image
block serialization breaks requests to local OpenAI-compatible providers).
All reactions