返回目录
模型与 MCP 插件

dsh-mode-switcher

qrak/dsh-mode-switcher

Tab toggles Plan/Build in DeepSeek Harness; each mode keeps its own model and reasoning preset across restarts.

Stars
0
Forks
0
Issues
0
更新
8 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:qrak/dsh-mode-switcher

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-mode-switcher

ci license: MIT

Switch Plan and Build in DeepSeek Harness with Tab or a click, and let each mode keep its own model + reasoning effort. Set the model once in Plan, once in Build, and the switcher restores the right one on every toggle, /plan, /plan off, and plan approval.

This is an independent, MIT-licensed implementation of the idea popularized by gaoyinxin/dsh-mode-switcher. It contains no code or assets from that project.

Screenshots

Build — 🛠️ Build ⇥ Tab

Build mode chip in the composer

Plan — 📋 Plan ⇥ Tab

Plan mode chip in the composer

Why this implementation

  • Persistence that fits each surface. The Desktop window runs on the stable dsh-app://app origin, so presets live in localStorage and survive restarts. The browser web UI gets a random 127.0.0.1 port each launch, so the plugin also writes a host-scoped cookie and reads whichever copy is newest.
  • Only plain Tab. Shift+Tab, Ctrl+Tab, Alt+Tab and Meta+Tab are left to the application; so are IME composition and auto-repeat.
  • Errors are visible. If a saved model was removed or an effort level is unsupported, the chip shows a warning, the stale preset is cleared, and the mode still switches.
  • No network, no telemetry, no secrets. The plugin talks only to the DSH session API and stores a small JSON preset in browser storage.
  • Tested. The preset logic, cookie parser, keyboard predicate, chip lookup and the mode state machine have unit tests, and CI runs them on Node 22 and 24.

Install

DeepSeek Harness Desktop. Its profile is desktop and Electron manages it, so install from the UI: open Plugins in the sidebar (Settings holds only the read-only Built-in plugins inventory), choose Add plugin, enter @qrak/dsh-mode-switcher, confirm Install.

Any other profile (web, TUI, your own), from the CLI — dsh plugin forwards its arguments to pnpm inside the profile directory:

dsh plugin --profile <your-profile> add @qrak/dsh-mode-switcher

--profile may be omitted to use the profile dsh boots by default.

Updating: re-run the install with @latest, or Install again in the Desktop UI, then restart DSH — the running process keeps the loaded plugin code in memory, so a package update alone changes nothing until the app restarts.

To try a change that is not released yet, install from the repository:

dsh plugin --profile <your-profile> add git+https://github.com/qrak/dsh-mode-switcher.git#main

Released versions are tagged v<version> (v1.0.0 … v1.0.4), so #v1.0.4 pins one exactly.

No build step, no dependencies, nothing to configure after install.

Usage

  1. In Build, pick the model and reasoning effort you want for implementation work (for example high).
  2. Press Tab (or click the chip) to enter Plan and pick the model/effort for planning (for example max).
  3. Switch back and forth; each mode is restored automatically, and the chip tooltip shows the saved Plan and Build presets.
  4. The presets also apply when the mode changes via /plan, /plan off, or approving a plan.

The chip replaces the native Plan-only chip, so it is always visible: 🛠️ Build ⇥ Tab or 📋 Plan ⇥ Tab (see Screenshots).

Behaviour and limits

  • Presets are global across sessions and stored in localStorage (Desktop dsh-app://app) plus the cookie dsh_mode_switcher_presets_v1 (browser web UI). If both are blocked, they fall back to memory for the page lifetime. Clearing site data resets them; each mode then re-seeds from the model in use.
  • Toggle commands are not echoed into the chat: the plugin hides the generic /plan command rows, so repeated mode switches do not flood the transcript. The chip is the mode indicator.
  • DSH saves the selected model as the deployment default as well; after a mode switch, new sessions start with the model of the mode used last. This is host behaviour, not a plugin setting.
  • The plugin intercepts Tab only while the composer has focus and no completion popup is open. If a future DSH version gives Tab a different meaning in the composer, disable the plugin or remove the key listener.
  • Tab toggles the composer the caret is in, resolved from the focused element, not the conversation painted last. With several conversations mounted, a global "last chip" could target the wrong session.
  • A second toggle of the same session within 1 s is ignored, because it would undo the first one and leave a stale "switched to plan mode" notice queued in the chat.
  • If the saved model is no longer available, the switch still happens and the warning explains why the model was not restored.

Compatibility

Built and verified against DSH 0.2.2-rc.3 (Desktop 0.2.2-rc.3); engines.dsh allows >=0.2.0-rc.1. It uses the public client surface: ctx.slots (conversation.input.plan), the plan and modelSelection projections, remote.commands.execute, remote.session.selectModel, and ctx.locale. A future DSH release may change these; the plugin is versioned and pinned, and the plain /plan command keeps working without it.

Development

npm run check   # node --check for both entry points
npm test        # node:test, no dependencies

The repository has no build step and no runtime dependencies.

Prior art

The Tab toggle and per-mode model memory were popularized by gaoyinxin/dsh-mode-switcher. This repository is an independent implementation under the MIT license; it does not include that project's source, icon, or screenshots.

License

MIT © 2026 qrak

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度中

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。