Replies: 1 comment
|
The hard selection check can be passed without deleting or rewriting the original image events: use a companion route that admits the image history but forwards text-only to the original model. dsh plugin --profile web add pi2dshpi2dsh adds the same DeepSeek models under a DeepSeek + Vision Bridge provider group. Selecting that row succeeds because the companion advertises image admission. Before calling the original DeepSeek adapter, it traverses the complete request history and replaces image blocks, including nested tool-result images, with explicit text notices; materialized attachments retain a local file path. Add |
Uh oh!
There was an error while loading. Please reload this page.
Bug:
session.selectModelhard-rejects switching to a text-only model when the session history contains images — should auto-filter instead问题现象 / Symptom
In a Web session whose history contains any image (e.g. screenshots pasted or produced by tools), switching the model to one with
inputModalities: ["text"](all DeepSeek models) fails entirely with:The session is then permanently locked to image-capable models (here: MiniMax-M3 only), even though the images are only in the historical tool results and the user just wants to keep chatting about the text content.
复现步骤 / Reproduction
session-b79a5217...), paste or let a tool produce any image (e.g.read_imageon a screenshot). Confirmed: 12 image blocks exist astool/resultcontent.deepseek-official / deepseek-v4-flash.POST /api/session.selectModelwith{sessionId, provider:"deepseek-official", model:"deepseek-v4-flash"}returns themodel-unavailableerror above. A fresh session without images switches to the same model successfully.根因 / Root cause
packages/host/apiproxy(built filedsh-host-apiproxy/lib/index.js):session.selectModelhandler (~L2685):messagesHaveImage→contentHasImage(dsh-llm, L650) recursively counts images inside historicaltool-resultblocks too.buildModelCatalogdoes not exposeinputModalitiesto the Web client, so the model picker cannot pre-mark which models reject image sessions.建议修复 / Suggested fix
Instead of rejecting the switch, filter/redact the unsupported modality when the selected model cannot consume it, then proceed:
selectModel, if the target model has noimageinput modality, strip image blocks from the derived conversation for that model (replace with a placeholder like[image omitted: model does not support image input]), keep all text, and allow the switch. Optionally warn the user that images will not be sent.session.promptalready rejects when the current model can't take images — that one is fine).inputModalitiesinsession.modelscatalog so the picker can disable/annotate incompatible models up front.This matches the user expectation: history images are context, not a permanent model jail.
环境 / Environment
0.1.0-rc.6(@deepseek-ai/dsh,@deepseek-ai/dsh-host-apiproxy)deepseek-official(all modelsinputModalities: ["text"]),minimax-cndsh webAll reactions