[Bug] Image upload rejected with "current model does not support images" even after switching to a non-DeepSeek model — custom pi-ai provider models silently default to text-only input #356
wizardcypress
started this conversation in
General
Replies: 1 comment
|
原帖给出的 dsh plugin --profile web add pi2dsh@0.11.0
dsh plugin --profile web add @kassing/pi-vision
export VISION_BRIDGE_BASE_URL=https://gateway.example.com/v1
export VISION_BRIDGE_MODEL=vision-model
export VISION_BRIDGE_API_KEY=$MY_GATEWAY_API_KEY重启 Web 后选择 DeepSeek + Vision Bridge 伴生分组并直接贴图。伴生 route 负责图片准入; 这条链已用真实 DSH Web 图片会话完成端到端验证。复现步骤和测试图:pi2dsh vision-bridge example。 |
0 replies
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.
Summary
dsh Web UI (v0.1.0-rc.3) rejects image uploads with "当前模型不支持图片,请切换支持图片的模型" (the current model does not support images; switch to a model that does). The error persists even after switching to a model on a custom OpenAI-compatible provider (added via
~/.dsh/settings.yamlunderllm-pi-ai) that actually serves vision models. The root cause is that hand-declared models not present in the installed pi-ai catalog silently fall back toinputModalities: ['text'], and there is no UI surface to declare image support.Environment
dsh web), macOSllm-pi-ai.providersinsettings.yaml, with hand-declaredmodelsentries (id + name only)Repro steps
In
~/.dsh/settings.yaml, add a custom provider tollm-pi-ai.providerswith an OpenAI-compatiblebaseURL/api, and hand-declare one or more models without aninputfield:Start
dsh web, open a session, and switch the model picker tovision-model.Upload an image and send.
The composer shows: 当前模型不支持图片,请切换支持图片的模型 (or in English: The current model does not support images; switch to a model that does).
Expected behavior
After switching to a model that supports images, the image should be accepted and sent.
Root cause
The
promptadmission check in the host API (packages/host/apiproxy/src/api-proxy.ts) callsctx.llm.resolveModelInfo(provider, model)and rejects the prompt wheninputModalitiesis defined and does not includeimage(error codeMODEL_DOES_NOT_SUPPORT_IMAGES). The same check also blocks model switching into a session that already contains images.dsh-llm-pi-airesolves a model's input modalities as: entryinput→ installed pi-ai catalog entry → routedefaultInput, and the routedefaultInputitself defaults to['text'](packages/llm/llm-pi-ai/src/config.ts,DEFAULT_INPUT). Every model added through the web UI's "add a custom provider" card is hand-declared and unknown to the catalog, so it always resolves to text-only — no matter what the gateway actually serves.This conservative default is deliberate (see Agent Note
.agents/notes/implemented/architecture/2026-08-12-pi-ai-route-default-input-modalities.md): pi-ai silently downgrades images to a "(image omitted)" placeholder for models whoseinputlacksimage, so refusing early is safer than claiming a capability the endpoint may not have. However, the remedy — writinginput: [text, image]by hand insettings.yaml— is undiscoverable for web-only users, and the model-settings editor exposes neither the per-modelinputfield nor the route-leveldefaultInput.The error message itself ("switch to a model that does [support images]") offers no reachable fix, because no configuration surface could make a hand-declared model image-capable at the time.
Fix
Immediate workaround (no upgrade needed, hot-reloads):
Declare image support at the route (applies to all undeclared models on the route) or per model:
settings.yamlis watched by the settings service (chokidar, default on), so the change applies without restartingdsh web.Code fix (implemented locally, ready for upstream adoption):
packages/client/ui-settings-models: the pi-ai model-list editor's advanced fold now has an "Image input" checkbox per model — checking it writesinput: ['text', 'image'], unchecking drops the declaration. This closes the discoverability gap at the surface that creates hand-declared models. Tests added;ModelListEditor.tsxat 100% coverage.packages/client/ui-conversation: theMODEL_DOES_NOT_SUPPORT_IMAGESmessage now points to the fix ("…or enable image input for it under Models settings" / 或在"设置→模型"中为该模型开启图片输入).Validation:
test:gui(3756 tests),typecheck,lint,doc-sync(28 gates), and per-file coverage all pass.Suggestion for maintainers
All reactions