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_describe tool, which talks directly to any OpenAI-compatible vision model (token only, no harness provider).
  • Guards — drops an unsupported reasoningEffort/inherited maxTokens, 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.yaml under the apiKeyEnv name (or set apiKey directly).
  • route mode needs the vision provider registered in the harness (for example via llm-pi-ai).

Modes

ModeHow it worksRequires
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
toolImage → address text; the model calls vision_describe against an OpenAI-compatible vision model.only a token (apiKey / apiKeyEnv)
offOnly the sanitize/restore/history-shielding guards; no routing, no vision_describe.

Configuration

FieldDefaultDescription
moderouteroute / tool / off
visionProvider / visionModel'' / qwen3.7-plusroute-mode vision model
apiKey / apiKeyEnv''tool-mode credential (literal value / credential name or env var)
baseURLhttps://dashscope.aliyuncs.com/compatible-mode/v1OpenAI-compatible endpoint
visionMaxTokens4096max tokens for the vision call
visionTimeoutMs120000vision-call timeout
sanitizeReasoningEfforttruedrop reasoningEffort the target model doesn't support
sanitizeMaxTokenstruedrop inherited maxTokens when switching models
restoreSessionModeltrueswitch back to the session model on text turns
rewriteHistoryImagestrueshield historical images model-only on text turns

How it works

  • Browser client (lib/client.js): intercepts image drops and calls the official createDraftImages + addImages path; non-image drops are left to the default behavior.
  • Plugin host (index.js): agent/pre-step accumulates image turns and shields previous turns' images model-only via the surface-replace seam (the transcript keeps the original image); agent/request routes image turns to the vision provider (route mode) and sanitizes reasoningEffort/maxTokens; agent/turn-stopping republishes the default model context so the UI badge flips back immediately. In tool mode it registers the vision_describe tool.

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.

License

MIT