[Bug]: Compile cannot deliver image evidence with the VolcEngine backend (UNSUPPORTED_MEDIA)
Summary
Compile fails with UNSUPPORTED_MEDIA for any source directory that contains an image, when the configured VLM backend is VolcEngine (Ark):
UNSUPPORTED_MEDIA: Compile provider cannot deliver image evidence:
viking://user/zzk/resources/kb-bench-ov/2022年7月_乳品行业深度报告_东莞证券/page1_img1.png
The model is multimodal and the endpoint accepts the image, but the request is never sent: the compilation is rejected during source reading.
Root cause
read_source() rejects an image source before any model call when the provider cannot carry media inside a tool result:
bot/vikingbot/compile/sources.py(read_source) raisesCompileFailure("UNSUPPORTED_MEDIA", ...)whenprovider.supports_tool_result_media()is false.bot/vikingbot/providers/vlm_adapter.py(_backend_supports_tool_result_media) decides that capability from a hardcoded provider-name list:
return provider in {"anthropic", "openai-codex"}
VolcEngineVLM.provider is "volcengine", so it is rejected. VolcEngineVLM has no resolved_provider(), so the adapter falls back to vlm.provider.
The list is not arbitrary: it names the two backends that serialize image parts into tool results (tool_result blocks for Anthropic, input_image blocks for the Codex Responses API). OpenAI's own Chat Completions API restricts role="tool" messages to text parts, so that backend must stay excluded.
However, the Ark endpoint accepts an image_url content part inside a role="tool" message, so the VolcEngine backend can deliver native image evidence and is excluded only because of the name check.
Because _list_source_files() collects every file in a source directory, and PDF parsing leaves extracted page images next to the parsed Markdown, this affects every research-report directory.
Evidence
Measured against a self-hosted instance (v0.5.3 / main, vlm.provider=volcengine, vlm.model=doubao-seed-2.1-lite, vlm.api_base=https://ark.cn-beijing.volces.com/api/plan/v3).
The Ark chat endpoint accepts an image part in a tool message, and the model reads it:
[A] tool content = plain string -> HTTP 200
[B] tool content = [text, image_url(data:image/png)] -> HTTP 200
model: "The image is a solid, uniform fill ... a vivid, saturated red"
[C] user content = [text, image_url] -> HTTP 200
On the same instance, with the allowlist extended to volcengine, compiling a source directory of 3 Markdown files plus 54 PNGs completed with no error and no warning and produced a 50.5 KB analysis page whose content contains pixel-level readings that cannot come from the Markdown, for example:
- a price printed on a promo image ("多包同价 55.99 元/包")
- a numeric label in a narrow image strip ("仅含两处灰色文字「4103」")
- logo appearance ("蔚云知数品牌 Logo(紫色四格方块+紫色中文)")
Task metadata: status=completed, errors=[], warnings=[], 2 pages created, input tokens 2,123,209 / cached 966,672 / output 100,831.
Notes
- The failure is fail-fast by design:
service.pyre-raisesUNSUPPORTED_MEDIAinstead of recording it as a warning, so a compilation never silently loses image evidence. That is good behavior and should be kept. - The model being multimodal is not the relevant property. The relevant property is whether the backend's request format can carry an image part inside a tool result. The current code cannot express that distinction, because it decides by provider name.
Suggested direction
Let a backend declare the capability itself, instead of deciding it by provider name, and declare it for VolcEngineVLM:
bot/vikingbot/providers/vlm_adapter.py: consultvlm.supports_tool_result_media()when the backend provides it; keep the provider-name list as the fallback for backends that do not declare one.openviking/models/vlm/backends/volcengine_vlm.py:VolcEngineVLM.supports_tool_result_media()returns true.
This keeps OpenAI's own backend excluded (its API forbids image parts in tool messages) while letting a compatible backend that does support them opt in.
Related: #6713 (image sources in Compile), #6719 (the PR that introduced the current allowlist).
Production report and reproduction from a self-hosted instance (v0.5.3 / main, vlm.provider=volcengine, vlm.model=doubao-seed-2.1-lite).
The Ark chat endpoint accepts an image part inside a tool message, and the model reads it. Same endpoint, same model, same SDK:
[A] tool content = plain string -> HTTP 200
[B] tool content = [text, image_url(data:image/png)] -> HTTP 200
model: "The image is a solid, uniform fill ... a vivid, saturated red"
[C] user content = [text, image_url] -> HTTP 200
With the allowlist extended to volcengine, compiling a source directory of 3 Markdown files plus 54 PNGs completed with status=completed, errors=[], warnings=[] and produced a 50.5 KB analysis page. Its content contains readings that cannot come from the Markdown, for example a price printed on a promo image ("多包同价 55.99 元/包"), a numeric label in a narrow image strip ("仅含两处灰色文字「4103」"), and logo appearance ("蔚云知数品牌 Logo(紫色四格方块+紫色中文)"). Every cited image URI was checked to exist. Without the change, the same compilation stops with UNSUPPORTED_MEDIA on the first image.
Code path, for the record:
bot/vikingbot/compile/sources.py(read_source) raises before any model request is sent.bot/vikingbot/providers/vlm_adapter.py(_backend_supports_tool_result_media) answers withprovider in {"anthropic", "openai-codex"}.VolcEngineVLM.provideris"volcengine", andVolcEngineVLMhas noresolved_provider(), so the adapter falls back tovlm.provider.service.pydeliberately re-raisesUNSUPPORTED_MEDIAinstead of warning, so a compilation never silently loses image evidence. That fail-fast behaviour should be kept.
Proposed fix in #6942: let a backend declare the capability, and declare it for VolcEngineVLM, keeping the provider-name list as the fallback so OpenAI's own backend stays excluded.
@yeshion23333 @fujiajie666 the gate and the compile pipeline live under bot / ov compile; @qin-ctx the backend declaration touches openviking/models/vlm.
Follow-up on the design: the vlm slot holds the vision model, but the model configured there is not guaranteed to understand images, and the bot inherits that slot when bot.agents.model is absent. Two measurements shaped the fix:
- Ark exposes no model metadata API (
/modelsand/endpointsboth return 404), and deployments commonly address a model through a custom endpoint alias, so the model cannot be classified from its name. - Every model available on the
/api/plan/v3endpoint is multimodal (doubao-seed-2.0-mini,doubao-seed-2.1-pro,doubao-seed-2.1-lite); the legacydoubao-pro/doubao-lite/doubao-seed-1.6names return 404UnsupportedModelthere. The transport capability is therefore not model-specific on that endpoint, but the model dimension still has to be handled for other deployments and other endpoints.
So the fix does not guess. #6942 now handles three cases:
- The backend declares whether its request format can carry media inside a tool result. The declaration is authoritative; the provider-name list stays the fallback, so OpenAI's own backend stays excluded.
- A provider that cannot carry the image keeps the source as a cited reference and sends the request without it.
- A model that rejects the image causes one retry without it.
Both fallbacks record a warning naming every affected source, so a skipped image is reported rather than passing unnoticed, and the compilation completes instead of failing.
Verified on a self-hosted instance with the real pipeline:
- Normal path, multimodal model:
completed,warnings=[], 54 PNGs delivered natively, and the 50.5 KB analysis page contains chart readings that cannot come from the Markdown (声量占比 37.75%,易用性约 23.5%,样本总量 4103,售价 55.99 元/包), each with its image URI. - Degraded path, provider forced to report no media support:
completed,error=null, one page still published, andresult.warningslisting all 54 skipped images with the reason.
The fail-fast behaviour was deliberate, so this changes it on purpose: the previous contract was "deliver the image or fail", the new one is "deliver the image, or record why it was skipped and continue". The source stays in the citation trail either way.
Thanks for the detailed report and image-delivery verification.
This is fixed on main by #6951. Compile now uses the backend's supported media transport. For VolcEngine, the original image is carried in a user message alongside the tool result, so it is no longer rejected solely because images cannot be embedded in that tool-result format.
The fix preserves the requirement to deliver image evidence rather than skip it and report successful compilation. The existing configuration-to-request tests verify that the image bytes are retained. Closing as fixed on main; this does not mean the fix is present in v0.5.3.