dsh-vision-auto
August 16, 2026 · View on GitHub
Image drag-and-recognize plugin for DeepSeek Harness. Drag images into the Web GUI — they keep showing as images, image turns are answered by a vision model, and text turns fall back to the session model with image history shielded. Text-only models (such as DeepSeek) never hit
UNSUPPORTED_CONTENT.
中文文档 · dsh-anydrop (full: files + folders + images)
This is the image-only subset. If you also want file/folder drag-and-drop, use the full plugin
dsh-anydrop.
Attribution — the image-recognition and model-routing module is derived from ysr666/dsh-vision-router (MIT). The image drag-and-drop module is independently implemented by this project; it does not come from dsh-vision-router. See Attribution.
Features
- Drag images — the client intercepts image drops and reuses the official draft-image pipeline, so the GUI shows the original image thumbnail.
- route mode (default) — image turns switch to a harness-registered vision model and read raw pixels; when the turn ends, the session model is restored and the UI badge flips back immediately.
- tool mode — image → address text in history; the model calls the built-in
vision_describetool, which talks directly to any OpenAI-compatible vision model (token only, no harness provider). - Guards — drops an unsupported
reasoningEffort/inheritedmaxTokens, and shields historical images model-only on text turns.
Install
cd ~/.dsh/profiles/web
pnpm add dsh-vision-auto@github:babutiger/dsh-vision-auto
Add to ~/.dsh/profiles/web/cordis.patch.yml:
- insert:
- id: vision-auto
name: 'dsh-vision-auto'
config:
mode: route # route / tool / off
visionProvider: qwen-dashscope # route mode: a harness-registered vision provider
visionModel: qwen3.7-plus
apiKeyEnv: QWEN_API_KEY # tool mode: vision-model credential name
baseURL: https://dashscope.aliyuncs.com/compatible-mode/v1
Then restart dsh web and refresh the page.
API key
- tool mode needs only a token for any OpenAI-compatible vision model; put it in
~/.dsh/.credentials.yamlunder theapiKeyEnvname (or setapiKeydirectly). - route mode needs the vision provider registered in the harness (for example via
llm-pi-ai).
Modes
| Mode | How it works | Requires |
|---|---|---|
route (default) | Image turns route to a harness-registered vision model (GUI shows the original image); other turns restore the session model. | a registered vision provider/model |
tool | Image → address text; the model calls vision_describe against an OpenAI-compatible vision model. | only a token (apiKey / apiKeyEnv) |
off | Only the sanitize/restore/history-shielding guards; no routing, no vision_describe. | — |
Configuration
| Field | Default | Description |
|---|---|---|
mode | route | route / tool / off |
visionProvider / visionModel | '' / qwen3.7-plus | route-mode vision model |
apiKey / apiKeyEnv | '' | tool-mode credential (literal value / credential name or env var) |
baseURL | https://dashscope.aliyuncs.com/compatible-mode/v1 | OpenAI-compatible endpoint |
visionMaxTokens | 4096 | max tokens for the vision call |
visionTimeoutMs | 120000 | vision-call timeout |
sanitizeReasoningEffort | true | drop reasoningEffort the target model doesn't support |
sanitizeMaxTokens | true | drop inherited maxTokens when switching models |
restoreSessionModel | true | switch back to the session model on text turns |
rewriteHistoryImages | true | shield historical images model-only on text turns |
How it works
- Browser client (
lib/client.js): intercepts image drops and calls the officialcreateDraftImages+addImagespath; non-image drops are left to the default behavior. - Plugin host (
index.js):agent/pre-stepaccumulates image turns and shields previous turns' images model-only via the surface-replace seam (the transcript keeps the original image);agent/requestroutes image turns to the vision provider (route mode) and sanitizesreasoningEffort/maxTokens;agent/turn-stoppingrepublishes the default model context so the UI badge flips back immediately. In tool mode it registers thevision_describetool.
Attribution
The image-recognition and model-routing module in this plugin is derived from
ysr666/dsh-vision-router, licensed under the
MIT License. That module reuses the upstream
blocksHaveImage, eventHasImage, extractJson, createCache, and toOpenAIContent utilities and
its image-turn routing, history shielding, and vision_describe architecture.
The image drag-and-drop module is an independent implementation in this project. Its image-drop event handling, integration with the official Harness draft-image APIs, and related client logic do not come from dsh-vision-router. The project as a whole is distributed under MIT, with the upstream copyright and permission notice retained; see LICENSE.