FrostLeafKEE/dsh-image-unlock ↗★ 0
@dsh-external/dsh-image-unlock
Lift the 'model does not support images' gate in the DeepSeek Harness web GUI: declares image input for every llm-pi-ai model that does not state its own input modalities, so attachments are admitted, and textifies image blocks for the text-only opencode-go upstream (pair with a vision skill for actual recognition). Toggleable by the claude-vision-skill directory's presence: skill enabled = vision-skill flow, skill disabled = native vision model.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:FrostLeafKEE/dsh-image-unlock说明文档
阅读完整 README ↗🐳 dsh-image-unlock

解除 DeepSeek Harness Web GUI 的图片输入限制,让图片附件在不支持图片的上游(Console Go)下可用。
✨ 一张图看懂
🖼️ 上传图片
│
▼
🚪 准入闸门 ←── bundle patch:defaultInput: [text, image]
│ (未声明 input 的模型继承图片能力,不再被拒)
▼
🔧 图片文本化 ←── code patch:textifyImageBlocks()
│ (图片块 → [图片附件: ] 文本标记)
▼
🤖 agent 看到标记 → 👁️ vision skill 识图(vision.js 魔数嗅探 MIME)
🧩 问题
Harness 在 API 层(dsh-host-apiproxy)、LLM 层(dsh-llm-pi-ai)都根据模型的
inputModalities(来自 llm-pi-ai 的模型 input 声明)判断能否接收图片。
默认声明只有 text,因此未声明 input 的模型(如 deepseek-v4-flash)在发图时
会被拒绝("Model does not support image input")。
但只放行还不够:dsh-llm-pi-ai 会把 durable 图片块转成
{ type: "image", data: base64 } 部件,pi-ai SDK 序列化为 image_url 发送给
上游。Console Go 上游协议只接受 text,于是报:
400 invalid_request_error: Failed to deserialize the JSON body into the
target type: messages[605]: unknown variant `image_url`, expected `text`
也就是说:声明图片能力是"准入",但上游根本不收图片。正确做法是准入后把 图片块转成带附件路径的文本标记,识别交给 vision skill。
⚙️ 方案(两部分)
1. Bundle patch:准入(cordis.patch.yml)
给 llm-pi-ai 的 opencode-go provider 加上 defaultInput: [text, image],
让未显式声明 input 的模型继承 image 输入能力,从而通过 API 层 / LLM 层的
图片闸门。显式声明 input: [text] 的模型保持原样(用户层优先)。
2. 代码 patch:图片文本化(scripts/patch-pi-ai.mjs)
dsh-llm-pi-ai 的序列化没有配置开关,请求对象又是深度冻结的(llm/stream
waterfall 无法改写),所以对本地安装的包做一次代码补丁(已用
标记注释标注):