dsh-doctor
asdf17128
Find what your DeepSeek Harness (dsh) patches silently broke — dead patches, config fields dropped by whole-config repla…
PROJECT TOPICS
PROJECT README
Unofficial DeepSeek Harness client for VS Code
Bring the full DeepSeek Harness (dsh) agent harness into VS Code — Copilot-style chat, editor integration, session management, and model switching, all in one panel.
[!WARNING] This is an unofficial, community project — not a DeepSeek product. dsh-vsc is not affiliated with, endorsed by, or sponsored by DeepSeek or the deepseek-harness team. It is an independent, best-effort VS Code client for the open-source harness.
[!CAUTION] Very early alpha — use entirely at your own risk. This extension starts a local dsh agent server that runs model-driven code. The agent can create, modify, and delete files in your workspace, and it calls the DeepSeek API on your behalf, consuming your tokens and potentially incurring real costs. The software is provided "AS IS" without warranty of any kind, and the authors accept no responsibility for any errors, data loss, or costs arising from its use. Please read the full Disclaimer before using.
+added −deleted diff stats — click a write/edit to open the whole-file diff; reads open the file directly./compact, /export, /feedback, /goal, /permission, /plan).| Requirement | Version | Notes |
|---|---|---|
| VS Code | ^1.90.0 |
any recent stable build |
| Node.js | >= 22 |
only needed to build from source / run the extension host |
| dsh CLI | latest | not bundled — install with npm install -g @deepseek-ai/dsh |
| DeepSeek API key | — | set inside the extension, or via DEEPSEEK_API_KEY in the shell that starts dsh |
The extension does not bundle the CLI — install it first:
npm install -g @deepseek-ai/dsh
Then restart VS Code (or run dsh: Check dsh Installation). The extension will:
dsh on your PATH (or the path set in dsh.cliPath);dsh --profile web --port 0 and connect;Already running a dsh web server? Set
dsh.connectionUrl(e.g.http://127.0.0.1:3080) and the extension connects to it instead of starting its own.
Option A — build the VSIX and install it:
npm install
npm run package # → dsh-vsc-0.1.0.vsix
# VS Code: Extensions → ⋯ → Install from VSIX...
Option B — run from source:
npm install
npm run build
# press F5 to launch the Extension Development Host
Ctrl+Alt+D).The chat panel is a Copilot-style conversation: streaming assistant output, tool-call cards, collapsible reasoning, context meter, and per-turn token stats. Pending approvals and questions take over the composer so you can respond inline. The session rail on the right shows your history — create, fork, rename, and switch models per session.
Select code and hit dsh: Ask dsh About Selection (Ctrl+Alt+Shift+D) to send it with file context, or use the Explain / Fix / Generate Tests / Review code actions from the editor context menu or lightbulb. When the agent edits files, Copilot-style file-change rows appear in the chat with +added −deleted counts — click one to open the whole-file diff; read calls show a subdued row that opens the file directly.
The DeepSeek API key is stored through the dsh server's credential mechanism (default ~/.dsh/.credentials.yaml, 0600 permissions), matching the Models page of the dsh Web UI. When no key is configured you are prompted once after connecting; you can set or clear it any time with dsh: Set API Key / dsh: Clear API Key. Click the "dsh connected" status bar item to open a menu with settings entries.
If the shell that starts dsh already sets
DEEPSEEK_API_KEY, it is treated as a read-only source and the extension's writes are rejected — unset that variable in the shell that starts dsh before saving through the extension.
| Action | Windows / Linux | macOS |
|---|---|---|
| Open dsh Chat | Ctrl+Alt+D |
Cmd+Alt+D |
| Ask dsh About Selection | Ctrl+Alt+Shift+D |
Cmd+Alt+Shift+D |
All settings live under the dsh.* namespace in settings.json (command dsh: Open dsh Settings):
| Setting | Default | Description |
|---|---|---|
dsh.cliPath |
"" |
Absolute path to the dsh executable; empty searches PATH |
dsh.connectionUrl |
"" |
Connect to a running server; empty starts the CLI automatically |
dsh.autoStart |
true |
Start dsh when the extension activates |
dsh.autoConnectWorkspace |
true |
Create a workspace-rooted session after startup |
dsh.cwdStrategy |
workspace |
Working directory for new sessions: workspace / firstWorkspace / host |
dsh.agentPreset |
standard |
Agent preset for new sessions; standard renders the working directory + loads AGENTS.md, minimal does not |
dsh.provider / dsh.model |
"" |
Default provider / model for new sessions (empty = dsh default) |
dsh.reasoningEffort |
"" |
Default reasoning effort when the model supports it |
dsh.webviewTheme |
auto |
Chat panel theme: follow VS Code or force light / dark |
dsh.autoScrollThreshold |
100 |
Auto-scroll threshold (px from bottom) during streaming |
dsh.notifyOnChanges |
true |
Show a notification when the agent modifies files |
| Command | Description |
|---|---|
dsh: Open dsh Chat |
Open the chat panel |
dsh: Start dsh / Stop dsh / Restart dsh |
Manage the dsh server |
dsh: New Session |
Create a new session |
dsh: Session History |
Open the chat panel and browse history |
dsh: Select Model |
Switch the current session's provider / model / reasoning effort |
dsh: Set API Key / Clear API Key |
Manage the DeepSeek API key |
dsh: Ask dsh About Selection |
Send the selection with file context to dsh |
dsh: Explain / Fix with dsh / Generate Tests / Review with dsh |
Editor right-click / code actions |
dsh: Stop Current Response |
Cancel the current response |
dsh: Check dsh Installation |
Check whether the CLI is available |
dsh: Install dsh CLI |
Run the global install in a terminal |
dsh: Open dsh Web UI in Browser |
Open the dsh Web UI in the browser |
dsh: Open dsh Settings |
Open dsh.* settings |
dsh: Show dsh Menu |
Open the status bar menu |
npm install
npm run build # esbuild → out/extension.js + out/webview/app.js
npm run watch # incremental build
npm test # vitest (protocol / session fold / pure-function unit tests)
npm run typecheck # tsc --noEmit
npm run lint # eslint (flat config, recommended rules; see eslint.config.mjs)
npm run package # vsce package → dsh-vsc-<version>.vsix
Press F5 in VS Code to launch the extension host (requires Node ≥ 22).
npm test runs only the unit tests (test/**/*.test.ts) and never requires an API key. Two integration tests against a real dsh server auto-skip when the CLI is absent:
test/e2e-real-dsh.test.ts — needs a built deepseek-harness CLI; the checkout path comes from the DSH_REPO env var, defaulting to the sibling ../deepseek-harness.test/_probe-real-title.test.ts — a manual dev probe (prints traces, asserts nothing), skipped by default; run it explicitly with DSH_PROBE=1:
$env:DSH_PROBE=1; npx vitest run _probe-real-title (PowerShell)flowchart LR
subgraph VS Code Extension Host
WEB[Webview Chat Panel<br/>React 18] -->|request / push| RELAY[Message Relay]
EDITOR[Editor Integration<br/>Ask / Code Actions / Diff] --> SESS[Session Manager]
RELAY --> SESS
SESS --> PROTO[Protocol Client<br/>HTTP RPC + WS Downlink]
end
PROTO -->|HTTP / WebSocket| DSH[dsh Server<br/>--profile web]
DSH --> API[(DeepSeek API)]
src/shared/ — wire types (envelopes / frames / SessionEvent) shared verbatim by the host and webview; no VS Code dependency.src/host/ — CLI location, spawn, URL parsing, process lifecycle; the HostManager connection state machine.src/protocol/ — HTTP RPC client, dual WS downlink streams, reconnect, typed API.src/sessions/ — session-list cache, per-session event window (seq dedup / history paging / full-page replace), pending approvals/questions.src/webview/ — WebviewView provider and message relay (request/response correlation + push dispatch).src/editor/ — selection → context prompt, code actions, file snapshots and diff.src/settings/ — dsh.* config reads, session cwd strategy.src/install/ — CLI detection, status-bar indicator, install prompt.webview/ — React 18 front end: folds events into a render model (turn/step grouping, chunk accumulation, tool-call pairing).Current state: early alpha. The core loop — chat, sessions, model switching, editor integration, approvals, and diff — works end to end against a real dsh server.
Planned / not yet ported:
session.attachment upload)@-mentions in the composerContributions are welcome! This is a community project, so PRs, issues, and ideas all help.
npm run typecheck && npm run lint && npm test && npm run build.License: MIT. Copyright © 2026 the dsh-vsc contributors.
Unofficial status: dsh-vsc is an unofficial, community-maintained extension. It is not affiliated with, endorsed by, or sponsored by DeepSeek or the deepseek-harness project. "DeepSeek", "DeepSeek Harness", and "dsh" are trademarks or names of their respective owners and are used here only to describe compatibility.
No warranty / liability: the software is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in contract, tort, or otherwise, arising from, out of, or in connection with the software or its use. You are responsible for what the agent does in your workspace and for the API usage (and cost) it incurs.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。