DeepSeek Harness plugin

dsh-vision-bridge-34294914

DSH 识图桥接插件:让 DeepSeek 等纯文本模型会话也能发送图片——图片在进入模型前自动交给外部视觉模型(阿里云百炼 qwen-vl)识别,识别结果以文字形式喂给当前模型。

Jump to install

Source facts

Repository
342949145/dsh-vision-bridge
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/342949145/dsh-vision-bridge
Plugin: dsh-vision-bridge-34294914
Author: 342949145

Check the source files

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

File explorer3 files
README.mdSource · read only

dsh-vision-bridge

> GitHub: https://github.com/342949145/dsh-vision-bridge · License: MIT

> 适用范围:本插件只服务网页版 DSH~/.dsh,如 profiles/web/)。桌面版 Deepseek Harness EAC(当前 DeepSeek 会话所在形态)由内置插件 dsh-tool-vision 接管识图,配置在 %DSH_HOME%\settings.yamltool-vision 命名空间(当前模型 qwen3.7-plus / 阿里云百炼),无需安装本插件;两套配置互不相通,排查识图问题时先确认 DSH 形态。

DeepSeek 等纯文本模型 的 DSH 会话也能正常发送图片:图片在进入模型之前自动交给外部视觉模型(阿里云百炼 qwen-vl)识别,识别结果以文字形式喂给当前模型。无需切换模型、无需手动运行任何命令。

用户发图片 ──▶ DSH 会话(不再提示“当前模型不支持图片”)──▶ 本插件自动识图 ──▶ 文字描述 ──▶ DeepSeek 模型

解决的问题

DSH 将 DeepSeek 系列模型的输入能力声明为仅文本(inputModalities: ["text"]),因此:

  • 发送带图片的消息会被拒绝:“当前模型不支持图片,请切换支持图片的模型”(错误码 MODEL_DOES_NOT_SUPPORT_IMAGES);
  • read_image 工具同样被模型能力检查拦截;
  • 即使放行,DeepSeek API 本身也不接收图片。

本插件从两个层面解决:

1. 放行:包装 ctx.llm.resolveModelInfo,对目标 provider(默认 deepseek)的模型补充声明 image 输入能力,使所有模型能力检查通过; 2. 转译:包装目标 provider 适配器的 stream 方法,在消息进入序列化之前把 image 块逐个取出,调用百炼视觉 API 识图,替换为文字块——模型最终收到的始终是纯文本。

纯服务端插件,GUI 无需任何改动。不修改会话记录,不拦截原生支持图片的模型(如 pi-ai)。

安装

方式一:npm 安装(推荐,桌面版插件市场同款)

npm install dsh-vision-bridge

然后在 DSH profile(如 ~/.dsh/profiles/web/)中启用:

# ~/.dsh/profiles/web/cordis.patch.yml
- insert:
    - id: dsh-vision-bridge
      name: "dsh-vision-bridge"

或把 dsh-vision-bridge 加入 package.jsondsh.profile.bundles 列表。

方式二:本地开发挂载(link)

npm install link:./tools/dsh-vision-bridge   # 或 npm link

配置

配置优先级:环境变量 > 插件目录 .env > VISION_SKILL_DIR 指向目录的 .env / vision.js

变量必填默认说明
DASHSCOPE_API_KEY阿里云百炼 API Key(申请
DASHSCOPE_BASE_URLhttps://dashscope.aliyuncs.com/compatible-mode/v1OpenAI 兼容端点
VISION_MODELqwen-vl-max视觉模型(如 qwen-vl-plusqwen3.7-flash-2026-07-15
VISION_FALLBACK_MODELSqwen-vl-plus,qwen3.7-flash-2026-07-15主模型失败时的回退列表(网络错误/限流/5xx 自动回退,认证与参数错误不重试)
VISION_PROMPT请用中文简洁描述这张图片的内容。识图提示词
VISION_MAX_TOKENS256识别结果长度上限
VISION_MAX_EDGE512图片压缩最长边(像素)
VISION_JPEG_QUALITY80图片压缩质量
VISION_PROVIDERSopencode-go,deepseek-official,deepseek接管哪些纯文本 provider(逗号分隔;opencode-go 为 pi-ai 实际路由,deepseek-official 为官方 DeepSeek 适配器路由)
VISION_CACHEtrue识别结果缓存(内存 + 落盘 %DSH_HOME%/storages/,跨会话/重启复用)
VISION_GEN_MODELqwen-image文生图模型(generate_image 工具)
VISION_GEN_SIZE1024x1024文生图尺寸(1024x1024 / 720x1280 / 1280x720
VISION_SKILL_DIR复用 claude-vision-skill 配置的目录;自动读取其 .env / vision.js 中的 Key 与模型,无需重复填写

> 与内置 dsh-tool-vision 的图片桥冲突(重要):新版 DSH 内置插件 dsh-tool-vision 默认开启 bridgeTextOnly 图片桥(挂在 agent/pre-step 钩子),会把会话日志里的顶层 image替换成文本提示[User sent an image…, exported to: …]),结果是 GUI 永远不渲染图片、本插件的 generate_image 生成图也看不到。若 DSH 启用了 dsh-tool-vision,必须在 %DSH_HOME%/settings.yamltool-vision 段设置 bridgeTextOnly: false(settings.yaml 被 chokidar 实时监听,改动无需重启即热生效)。关闭后识图转换由本插件在 adapter.stream 层完成:日志保留 image 块(GUI 正常显示),发给模型的请求仍是纯文本。

最小配置示例(复制 .env.example.env):

DASHSCOPE_API_KEY=sk-xxxxxxxx

> 本插件不包含任何真实 API Key 或本机路径,可安全开源;请通过 .env(已在 .gitignore 中)或环境变量提供配置。 > > 设置页集成:插件注册了 dsh-vision-bridge 设置命名空间(%DSH_HOME%/settings.yaml),DSH 设置页可编辑;运行时优先级:设置页 > 环境变量 > .env > claude-vision-skill。

能力清单

能力说明
图片上传放行DeepSeek 等纯文本模型会话可正常附加图片(不再提示"当前模型不支持图片")
自动识图转文字图片(含 read_image 工具结果、tool-result 嵌套、历史重放)自动经视觉模型识图后喂给模型
模型回退链qwen-vl-maxqwen-vl-plus → flash,可恢复错误自动回退
文生图(generate_image对模型说"画一张…"即调用百炼 Qwen-Image 生成图片并保存为附件,模型可看到生成结果
识别缓存同图不重复调用 API(内存 + 落盘)
URL / OCR / 多图对比lib/vision.js 导出 describeImageUrlocrPromptdescribeImagesComparedataUrlFor 供复用

与 claude-vision-skill 的关系

claude-vision-skill 提供独立的 vision.js 识图脚本(手动运行 node vision.js <图片>)。本插件内置了等价的识图实现(压缩 + 百炼 API),并可通过 VISION_SKILL_DIR 自动复用其 API Key 与模型配置,两者互不干扰:

  • Codex / 手动场景:继续使用 claude-vision-skill;
  • DSH 会话场景:由本插件自动接管,发图即识图。

兼容性

  • 已验证 DSH 版本:0.1.0-rc.6(网页版 DSH 与 Deepseek Harness EAC 桌面版内置版本一致);
  • 上游 DSH 处于开发者预览期,如有破坏性变更请关注本仓库 Release 与 Issues。

工作原理

session.prompt(带图片)
  └─▶ ctx.llm.resolveModelInfo(插件包装)→ inputModalities 含 "image" → 检查放行
  └─▶ agent-loop prepareCall().stream(request)
        └─▶ adapter.stream(插件包装)
              ├─ 逐条检查 user 消息的 image 块
              ├─ attachments.readImage(ref) 读取图片字节
              ├─ 压缩(Windows PowerShell System.Drawing)→ data URL
              ├─ 调百炼 chat/completions(qwen-vl)→ 文字描述
              └─ 替换为 text 块 → 原始 adapter 继续

测试

node --test test/

License

MIT