DeepSeek Harness plugin

dsh-image-understanding

DeepSeek Harness 原生插件:让纯文本模型(如 DeepSeek)经 agent/pre-step 劫持 + resolveModelInfo 包装自动识别上传图片(qwen-vl),使纯文本对话也能“看见”图片。

Jump to install

Source facts

Repository
rison114514/dsh-image-understanding
Latest update
Aug 16, 2026
Category
Models & Providers
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/rison114514/dsh-image-understanding
Plugin: dsh-image-understanding
Author: rison114514

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

dsh-image-understanding

deepseek-harness (dsh) 里的纯文本模型(如 DeepSeek)也能"看见"你上传的图片 —— 自动调用阿里云百炼 qwen-vl 把图片转成文字描述再喂给模型,全程对模型透明,无需切换多模态模型。

> 配套说明:本插件是 deepseek-vision(WorkBuddy 钩子版)在 deepseek-harness 上的原生插件重写版。两者核心差别见文末「与 deepseek-vision 的差别」。

原理(两道闸都堵上)

deepseek-harness 对纯文本模型有两道图片拦截:

1. Gate 1 — 提交校验apiproxy 在消息含图时查模型 inputModalities,DeepSeek 是 ['text'],直接报错"当前模型不支持图片"。 2. Gate 2 — 序列化校验serialize.tsassertTextOnly 对 image block 无条件拒绝。

本插件在插件层同时解决,不碰 harness 源码:

  • 包装 ctx.llm.resolveModelInfo,让 deepseek 系纯文本模型"声称"支持 image,骗过 Gate 1;
  • agent/pre-step seam(serialize 之前)把 ImageBlockattachments.readImage() 取字节 → 百炼 qwen-vl 识别 → 替换为 【图片识别】… 文本块,DeepSeek 全程只见纯文本(Gate 2);
  • 仅模拟 deepseek 系纯文本模型;真·视觉模型原样透传,不被二次转换。

另外注册了一个显式 tool image_understanding,可手动按图片路径或 data URL 调用。

前置条件

  • 已本地安装并构建 deepseek-harness(能跑 pnpm dsh web
  • 一个阿里云百炼 API Key(OpenAI 兼容模式,申请:https://bailian.console.aliyun.com/ )

安装

# 一行安装(从 GitHub 以 DSH bundle 形式装入指定 profile)
dsh plugin --profile web add github:rison114514/dsh-image-understanding

装好后启动 web:dsh web(或 pnpm dsh web)。

使用

新会话 → 选择 DeepSeek 主模型 → 直接拖入 / 上传图片并输入"描述这张图" → 预期:

  • 不再弹出"当前模型不支持图片"
  • 图片被 qwen-vl 自动识别为文字描述并回填,DeepSeek 据此作答

也可在对话中显式调用 image_understanding 工具,传入图片本地绝对路径(或 data URL)做按需识别。

配置项(Web UI:设置 → 插件 → 插件配置 → image-understanding)

启动后在网页端「设置」→「插件」→「插件配置」里找到 image-understanding 卡片,按需填写并保存(改动即时生效,无需重启):

字段说明默认
api_key阿里云百炼 API Key(sk-...),必填;页面以只写输入框呈现,明文不会回传
model视觉模型 IDqwen3-vl-flash
base_urlOpenAI 兼容接口地址https://dashscope.aliyuncs.com/compatible-mode/v1
timeout单次调用超时(秒)20

> 想直接改文件也行:对应 $DSH_HOME/settings.yaml 里的 image-understanding: 小节,字段同上。

与 deepseek-vision 的差别

维度deepseek-vision(旧)dsh-image-understanding(本插件)
宿主WorkBuddy,靠 UserPromptSubmit 钩子外部进程deepseek-harness,cordis 原生插件
图片获取钩子读 stdin 的 transcript_path jsonl 取真实路径直接用 harness 内部 attachments.readImage() 取字节
注入方式识别结果写 additionalContext 注入pre-step 改写消息 + resolveModelInfo 包装骗过能力校验
安装install.shsettings.json 后重启pnpm dsh web --patch cordis.patch.yml 热加载
额外能力支持 SVG(Chrome headless 渲染)多注册了显式 image_understanding tool,支持图片路径 / data URL 按需识别

一句话核心差别:旧版是"在 WorkBuddy 外部挂一个钩子进程去拦截消息",新版是"在 deepseek-harness 内部作为原生插件、从消息序列化之前就接管图片"——更内聚、无外部进程依赖、不依赖解析 stdin 的隐式字段。

已知限制

  • 仅对 deepseek 系纯文本模型自动生效;其他模型需本身支持图片或不会被模拟。
  • 单图识别失败会降级为 【图片识别失败】… 文本,不阻断对话。
  • 拖放 / 上传图片受 harness 附件通道限制,仅支持 jpg/png/webp/gif;SVG、PDF 等非常规格式暂未做预处理。