dsh-remote
SSH remote work for DeepSeek Harness (DSH). DSH keeps running on your machine (the UI, model calls, API keys, sessions and your other plugins), while files, shell commands, terminals, search and the sandbox run on a remote host over SSH.
It is built on DeepSeek's own SSH providers (@deepseek-ai/dsh-ssh, dsh-fs-ssh, dsh-subprocess-ssh, dsh-sandbox-ssh). dsh-remote installs and matches their versions on both ends, writes the DSH profile for each host, and works around the bugs listed below.
Status: 0.1, headless. Running tasks from the command line works end to end. The web UI against a remote host is the next milestone (see Roadmap).
Requirements
- This machine: macOS or Linux, with DSH installed. The desktop app or the
dshCLI decides the DSH version. - The host:
- Linux (glibc 2.28 or newer) or macOS, on x86_64 or arm64.
- An OpenSSH alias that logs in without a prompt: key or agent auth, and the host key already in
known_hosts. Check withssh <alias> true. rg(ripgrep) for glob, grep and file search;bwrap(bubblewrap) on Linux to confine commands;git.- About 500 MiB free in the home directory.
Use
npm install -g @natgurlain/dsh-remote
dsh-remote setup myserver --workspace /home/me/project
setup does the following:
- Checks the host.
- Installs a runtime on the host: Node.js (checked against nodejs.org's checksums) and the DSH helper at your DSH's version. It goes under
~/.dsh-remote/runtime-<version>and is never written anywhere else. - Installs the same DSH version on this machine under
~/.dsh/remote/runtime-<version>, on its own Node.js. The desktop app's runtime can't be used; see U13. - Creates the profile
remote-myserverin~/.dsh/profiles. Its model provider settings are copied from yourdesktopprofile (--from-profilepicks another).
It prints the command to run a task:
~/.dsh/remote/runtime-<version>/dsh remote-myserver "run the tests and fix what fails"
Other commands:
| Command | What it does |
|---|---|
dsh-remote doctor <alias> |
Checks versions, digests, connectivity, ripgrep and the sandbox |
dsh-remote upgrade <alias> |
Follows a new DSH version, or repairs a changed runtime |
dsh-remote remove <alias> --yes |
Deletes the profile (sessions are kept) and prints the command that deletes the host runtime |
Where things live
| What | Where |
|---|---|
| Model calls, API keys, transcripts | This machine. Sessions go to ~/.dsh/remote/<alias>/sessions, apart from the desktop app's |
| Files, bash, terminals, glob/grep, git, PTC programs | The host, inside the workspace sandbox |
Project AGENTS.md and project skills |
Read from the host |
User-level skills in ~/.dsh/skills |
Not loaded in remote sessions yet |
How it works
The profile disables DSH's local subprocess, sandbox and fs-sandbox providers and mounts four rows instead:
| Row | Package | Provides |
|---|---|---|
remote-ssh |
@natgurlain/dsh-remote |
ctx.ssh: one OpenSSH master to the host, plus the helper |
fs-ssh |
@deepseek-ai/dsh-fs-ssh |
ctx.fs on the host |
remote-subprocess |
@natgurlain/dsh-remote/subprocess |
ctx.subprocess on the host |
sandbox-ssh |
@deepseek-ai/dsh-sandbox-ssh |
ctx.sandbox: the host's bubblewrap or Seatbelt |
ptc-runtime runs on the host's Node, and the sandbox root is the remote workspace. The helper's SHA-256 is written into the profile, and the connection refuses a helper that doesn't match it.
Upstream issues
These are DSH bugs dsh-remote works around. Each workaround is removable once upstream fixes the bug.
| Bug | Workaround | |
|---|---|---|
| U1 | dsh-ssh's ssh -O forward control command reads the user's ssh config, so LocalForward lines in the alias are requested again; when their ports are busy, every process stream fails |
Control commands get -F none (ClearAllForwardings=yes would also drop the requested forward) |
| U2 | glob, grep and file search run the ripgrep binary packaged on this machine through the remote subprocess provider | Such spawns are pointed at the host's rg |
| U8 | Remote commands receive this machine's DSH_HOME, DSH_PROFILE_DIR, DSH_INSTALL_DIR and DSH_NODE_EXECUTABLE |
Those variables are dropped |
| U9 | No prebuilt ssh-helper archives are published | Node.js plus npm install on the host |
| U13 | The desktop app's Electron runtime (BoringSSL) lacks PSK-AES256-GCM-SHA384, which dsh-ssh pins for every stream (NO_CIPHER_MATCH) |
Remote profiles boot on npm DSH on Node.js |
Not worked around yet: a dropped connection fails the turn in progress, and remote processes stop when the helper's lease expires (U-reconnect). The web UI's workspace registry and session creation use this machine's filesystem (U3, U4), and the turn change summary breaks (U5). A large output's spill file is written on this machine (U6), and user-level skills are looked up on the host (U7).
Roadmap
- 0.2, web UI:
dsh-remote open <alias>serves the DSH web UI for the host, with a folder picker that browses the remote machine, a host-filesystem bridge for the workspace registry, reconnect with status, and/remote status|reconnect. - 0.3, parity: syncing user skills, a remote spill file, a turn change summary, attachments, and
dsh-remote forward <alias> <port>. - Later: remote sessions inside the desktop window, which needs per-agent service scoping in DSH.
Development
pnpm install
pnpm typecheck && pnpm test && pnpm build
# try a local build against a host, in a scratch DSH home:
DSH_HOME=/tmp/dsh-remote-test node lib/cli.js setup myserver --plugin "$(pnpm pack | tail -1)"
License
MIT
还没有评论,来写第一条。