Preface¶
When developing agents in DSH, a common practice is to fix a set of prompts and a tool loop, then hook up different APIs. If you want to use Kimi Code’s execution methods (prompts, tools, Skills, permissions, and compression) within the same native session without launching a separate Kimi CLI subprocess, you need explicit model and harness binding on the DSH side. The following introduces how the community plugin dsh-harness-switch (maintained by AlyceStocking) works in this scenario.
What is this¶
dsh-harness-switch is a plugin for selecting models and harnesses within native DSH sessions. Starting from v0.3, it embeds the actual execution core of open-source Kimi Code into the plugin: prompts, tool definitions and execution, Skills, permission rules, MCP, and context compaction are provided by the Kimi core, without launching a Kimi CLI chat subprocess. The npm package name is dsh-harness-switch, the current public version is 0.3.3, and the license is MIT.
Core Features¶
Three Harness Modes¶
Each model binding can select one harness in the settings:
| Harness | Behavior |
|---|---|
| Kimi Code · embedded core | Full embedded Kimi execution core, default option |
| Kimi prompt · legacy | Adaptation prompts from v0.2, using DSH for tools, Skills, and compaction |
| DSH native | Kimi API + DSH native prompts, tools, and execution loop |
To compare the performance of the same model under different harnesses, simply add two bindings and select the same model alias. The README states that harnesses for other vendors have not yet been implemented.
Native UI and Execution Projection¶
DSH’s session list, input box, and final response remain native. A single Kimi execution appears in the interface as a kimi_harness_turn tool card, displaying Kimi tool calls/results, thinking, Skills, and compaction events within the card; real tools are executed only once inside Kimi. The DSH outer model adapter only orchestrates the local entry point and does not execute the model a second time for the same turn.
Permissions and Bridging Commands¶
The Kimi core adopts a manual permission mode: actions requiring approval, workspace trust, and questions map to the native DSH approval/question interfaces; denial, cancellation, or unavailability do not automatically pass. DSH needs to configure a usable approval UI and an allow-asking policy (policy: ask); the never policy will reject actions requiring approval. The plugin does not modify global approval settings.
The input box can directly send:
/kimi-skill <name> [task]: Explicitly activate a Skill via the upstream SDK/kimi-compact [content to retain requirements]: Call Kimi’s own compaction
Switching between DeepSeek and Kimi in the Same Session¶
After the current generation ends or is stopped, you can select an existing DeepSeek model in the same native session to resume its DSH prompts and tools; when switching back to Kimi, the history of other models will be imported into Kimi as reference history (thinking fields from other models are removed during cross-model history import).
Image Input (embedded core)¶
Since v0.3.1, the embedded core supports text, single image, and multi-image mixed input: it reads DSH-verified attachments and submits them via the Kimi SDK’s native image_url content blocks. The model configuration must include capabilities = ["image_in", "thinking"] (other capabilities can be retained); legacy and DSH native paths still only support text.
Installation and Enabling¶
Install from npm (Recommended)¶
The installation command for the desktop profile provided in the materials is:
dsh plugin --profile desktop add dsh-harness-switch@0.3.3
0.3.3 includes a fix for immutable installation packages within the profile from 0.3.2, as well as DSH 0.2 RPC / tool-result compatibility fixes. If you have previously used @local/dsh-harness-switch on your machine, please back up the profile before migrating, completely exit DSH, and remove the old package before installing the new one to avoid duplicate registration; do not delete $DSH_HOME/storages/harness-switch or the Kimi home. The README notes that the package name migration has not yet undergone real desktop end-to-end verification, and existing local installations are not forced to migrate immediately.
Environment and Verification Scope¶
The README has verified Windows, DSH Desktop 0.2.0-rc.2; minimum Node 24.15. Desktop installation uses the application’s built-in CLI and pnpm.
When installing from source to the desktop profile (material example, not the only path replacing npm market installation with git clone):
cd dsh-harness-switch
npm ci
npm run install:desktop
# Execute after completely exiting Desktop
npm run install:desktop -- --apply
The default DSH directory is %USERPROFILE%\.dsh (or environment variable DSH_HOME). When customizing the home or desktop directory:
node scripts/install-profile.mjs --home <DSH_HOME> --desktop-dir <desktop installation directory> --profile desktop --apply
Kimi Configuration¶
No need to install Kimi CLI, but a valid Kimi configuration and authorization are required. Example config.toml snippet:
[providers.kimi]
type = "kimi"
base_url = "https://api.kimi.com/coding/v1"
api_key_env = "KIMI_API_KEY"
[models."kimi-code/k3"]
provider = "kimi"
model = "k3"
max_context_size = 262144
capabilities = ["image_in", "thinking"]
Model ID, endpoint, and context limit are subject to account permissions and Kimi official configuration documentation; the process starting DSH must be able to read the corresponding environment variables.
Typical Usage¶
After restarting DSH, go to Settings → “Model Harness”:
- Confirm the Kimi configuration directory and click “Read Configured Models”. Reuse the endpoint, model, and API key / environment variable / file OAuth from
config.toml; credentials are not copied into the plugin configuration or the frontend. - Select Kimi Code · embedded core for model aliases like
kimi-code/k3and save. Old configurations will not be silently migrated; you need to manually change the selection to embedded core. - Select this binding in the native model picker under Kimi · Harness Switch, select the workspace, and chat normally.
- When you need to compare harnesses or switch back to DeepSeek, simply switch the binding or model within the same session as described above.
The plugin settings file is located at $DSH_HOME/storages/harness-switch/<DSH_PROFILE or default>.json by default; for multiple profiles, you can specify an independent absolute path settingsFile in the plugin configuration.
Scenarios and Notes¶
Who it is for: Developers already doing native session development on DSH Desktop who need Kimi Code API and want to compare the three execution paths (embedded / legacy / DSH native) within the same session.
Consistency and Boundaries: The plugin fixedly reuses the Node SDK, agent core, and other modules specified by the Kimi Code commit, with build artifacts and MIT license retained in vendor/. The same core version and configuration try to maintain consistent behavior, but there is no promise of being byte-for-byte identical to Kimi CLI; host identity, workspace, session state, and cross-model import history will all affect requests.
Storage and Recovery: Raw Kimi logs and execution state are in the Kimi home; the DSH side stores execution projections and final answers. Full recovery requires retaining DSH storage, the engine/ directory next to the settings, and the Kimi home simultaneously. Changing the Kimi home, workspace, or fixed core version for the same session will refuse to reuse old state, requiring a new session; do not operate on the same Kimi session used by the plugin simultaneously with the CLI.
Security and Permissions: This is a plugin execution bridge, not an operating system sandbox; the embedded mode uses Kimi’s policies, and DSH global system prompt extensions are not automatically injected into the Kimi core. Please read the repository source code and MIT license before installation; the plugin runs with the current DSH process permissions and is equally sensitive to the host environment when involving Bash, MCP, and file access.
Uncovered Capabilities: Video, Kimi CLI exclusive panels, terminal shortcuts, and all slash commands have not been ported; Kimi native token usage has not yet been mapped to DSH outer statistics; background tasks, MCP, and all platform tools are marked in the README as not yet verified item by item end-to-end.
Links¶
- Community Directory: https://www.skillhub.cn/plugins/AlyceStocking/dsh-harness-switch
- Source Code and Instructions: https://github.com/AlyceStocking/dsh-harness-switch