Introduction¶
In DSH (DeepSeek Harness), model selection, session history, permissions, stop controls, and token statistics are usually managed uniformly by DSH. If you want to delegate certain turns to Claude Code, Codex, or Kimi Code for execution, common challenges are: maintaining an extra set of CLI sessions and model configurations, or mixing external CLI activities into the DSH tool stream, leading to inconsistent statistical metrics and repeated tool execution.
The approach of dsh-harness-ally is to integrate these types of execution entry points into the same DSH session lifecycle: models are still decided by the DSH native model selector, while the Harness switches per turn.
What is this¶
dsh-harness-ally is a DSH Agent Preset maintained by BaronCyrus, licensed under MIT.
It solves the problem of allowing DeepSeek Harness, Claude Code, Codex, and Kimi Code to share the same DSH session lifecycle and be freely combined with the DSH native model selector.
It does not replace DSH’s composer/model selector. The model directory still follows existing DSH configurations, and the Harness is decided by an independent “Select Harness” control.
Core Capabilities¶
Separation of Model Selection and Harness Selection¶
- Continue using the DSH native model selector to select
provider/model. - Automatically use all currently configured
provider/model. - Switch between DeepSeek Harness, Claude Code, Codex, or Kimi Code per turn.
- The Harness selector only appears in “Harness Alliance Mode”; it is completely hidden in Standard mode.
- After selecting Claude Code, Codex, or Kimi Code, the corresponding CLI performs the actual execution.
Visibility of External Execution Process¶
- External turns immediately display
Harness · Executing. - Public thinking/reasoning summaries,
Bash, file modifications, WebSearch, MCP, and other activities are displayed in real-time in the read-only Think process area. - Claude Code uses partial messages, Codex uses app-server, and Kimi Code uses ACP
session/update.
No Fake Tool Calls for External Activities¶
- External activities are never disguised as DSH tool calls to prevent the Standard Agent from executing the same command repeatedly.
CLI Auto-Detection and Managed Installation¶
- Prioritize the global CLI in
PATH. - If missing, display “Install” inside the Harness menu.
- Install into the DSH private directory without using sudo.
- The preset also provides
subagent_claude_code,subagent_codex, andsubagent_kimi_code.
Token Statistics and Session Docking¶
- The uncached/cache-read/cache-write/reasoning tokens from external Harnesses are returned to the DSH native token meter.
- Conditional native session docking and resumption: for consecutive turns, only the current request is sent; for switching back across Harnesses, only the completed canonical history during the absence is submitted.
- Cleanly completed and non-cancelled external runs will consolidate structured activities into a bounded, versioned activity log and apply desensitization to common credential formats.
Requirements¶
- DSH (DeepSeek Harness) Web deployment
- Node.js and pnpm (DSH Web Profile uses pnpm)
- macOS, Linux, Windows
- Claude Code, Codex, and Kimi Code CLI are optional: you can install them globally beforehand, or install them on-demand via the “Select Harness” menu.
Installation¶
First clone to the fixed preset path, then execute the installation script:
git clone https://github.com/BaronCyrus/dsh-harness-ally.git ~/.dsh/.agent-presets/harness-ally
node ~/.dsh/.agent-presets/harness-ally/setup/install.mjs
If DSH_HOME is set, replace ~/.dsh in the command with the corresponding directory.
After installation, restart the existing dsh web process, then create a new “Harness Alliance Mode” session. Do not start a separate web server; the open GUI will only connect to the original DSH process.
Typical Usage¶
- Continue using the DSH native model selector to select
provider/model. - Open “Select Harness” and choose DeepSeek Harness, Claude Code, Codex, or Kimi Code.
- Send messages normally. The Harness will be locked during the turn, and stopping is still controlled by the native composer.
- External turns will first appear as
Think · Harness · Executing, followed by real-time updates of thinking and tool activities. - A
Harness · modelbadge will appear below the final message. - If Claude Code, Codex, or Kimi Code is missing, it cannot be selected directly; only an “Install” button will be shown. Once installed, it can be selected.
The CLI parsing order is “Global PATH priority, DSH managed directory fallback”.
Applicable Scenarios and Notes¶
Suitable for developers who want to retain unified model selection, session history, and statistical metrics in DSH while borrowing external CLI execution capabilities per turn.
Please note:
- The plugin runs by joining the existing
dsh webprocess and is constrained by current DSH configurations,DSH_HOME, sandbox, and permission policies. - Non-
danger-full-accessmode is wrapped by DSH’s outersandbox.confine(). - It is recommended to check the source code and MIT license before installation, and confirm whether the current DSH build supports the required behaviors.
- Double-source context fixing requires DSH’s
TokenUsageand token-meter to supportcontextInputTokens/contextOutputTokens; older DSH builds will ignore new fields. - Currently, external Harnesses running in the foreground only accept text requests; if the latest top-level user message contains an image, a clear prompt will appear before dispatch to switch back.
- Prompts are transmitted via stdin, app-server RPC, or ACP JSON-RPC, and do not appear in argv.
- The bridge only listens on
127.0.0.1, and each route uses a random bearer token. - Error diagnostics do not return the CLI’s original stderr, route token, or environment variables.
- Native session lanes are isolated by
DSH session × Harness × provider × model. - Vendor sessions are discardable cache; DSH Session logs are always the unique canonical history.
- Codex’s reasoning encapsulation uses a persistent AES-256-GCM key, located at DSH state with permissions
0600; this mechanism does not constitute an independent security boundary capable of resisting simultaneous reading of the key and the managed state.
References¶
- GitHub: https://github.com/BaronCyrus/dsh-harness-ally
- Directory page: No confirmed link provided; search for the repository name in the plugin directory.