dsh-remote-sessions: Running remote DSH Agents in an unmodified native UI

Preface

In DSH, the common approach for agent development is to open a local workspace, running sessions and terminals on the local runtime. When models and computing power are on another machine, or when you want a remote directory to serve as the actual workspace, you often have to set up an additional remote web interface, custom chat panel, or rely on solutions like dsh-remote. This can lead to a disconnect between the local interface and remote execution.

Here we introduce the community plugin dsh-remote-sessions (maintainer atlas5301): it is a standalone native-session backend. It does not bring its own client entry, custom chat panel, remote web app, or browser dependencies, nor does it rely on dsh-remote. The local side remains the Existing native DSH frontend (unchanged). It connects to independently hosted remote DSH and companions via strict SSH / bounded protocol, using ordinary session APIs, local “metadata-only” sessions, and a backend proxy. The remote side retains AgentLoop, models, tools, files, and persistence. Sessions, file trees, terminals, Composer, approvals, and history all utilize the original native UI.

What is this

In one sentence: built upon a strict-SSH resident lifecycle, it handles session / file tree / terminal forwarding and persistent binding, allowing you to operate remote Agents in local DSH just like using a local workspace, without modifying the core or switching interfaces.

Core Features

Architecture Layers

The structure in the documentation can be summarized as:

Existing native DSH frontend (unchanged)
                  │ ordinary session APIs
Local metadata-only session + backend proxy
                  │ strict SSH / bounded protocol
Independently supervised remote DSH + companion
                  │
Remote AgentLoop, models, tools, files and persistence

Settings Page & Managed Workspaces

The plugin provides one native settings section “Remote Sessions” and the corresponding backend, without taking over via extra chat panels, sidebar entries, or workspace selectors.

  • Machines: Add machines by name and SSH target; Detect performs a read-only SSH probe (Node path/version, npm, installed DSH CLI, and fills in security defaults like socket and directory); Start triggers automatic setup; Upgrade appears when a new resident bundle is available (refused if there is active work on the remote). Machines with associated workspaces cannot be deleted.
  • Remote workspaces: Open remote workspace browses over strict SSH (Machine → Directory → Optional new folder → Open). Upon opening, it: creates a real workspace on remote DSH (forwards workspace/create, idempotent); links a plugin-managed local anchor (~/.dsh/remote-sessions/anchors/…, no manual creation needed by user); starts the native workspace and first session, after which the ordinary UI takes over. One machine can have multiple workspaces, and multiple machines can coexist; each mapping is one managed anchor ↔ one remote directory. Unlink only deletes the mapping; the anchor and remote workspace remain.

Local anchors are not sync mirrors and do not host remote agents; relative path @file completion comes from the remote session; uploaded files go into remote attachment storage. Mappings only apply to newly created sessions; existing local sessions will not be silently migrated to remote. Persistent proxy bindings retain machine authority, runtime UUID, process instance, session ID, and directory, even if config changes later.

Remote Resident Auto Setup

Installing the local plugin does not actively SSH; for configured machines, upon first use, the transport layer goes through strict SSH relay first. If the private socket does not exist, the setup facade runs before a single retry:

  1. Detection: Read-only probe of node version, DSH CLI path/version, resident marker (<runtimeDirectory>/resident.json), private socket, and PID.
  2. Reuse: A socket already serving will not be stopped, replaced, or rewritten.
  3. Start: A provisioned but not running resident is started using the recorded CLI without modifying files.
  4. Provision: If missing, create it—private directory, upload resident bundle (tar) via stdin, combine profile with @deepseek-ai/dsh-base and resident bundle, detach start (setsid, fallback to nohup) and write PID. If remote lacks DSH CLI, run npm install -g @deepseek-ai/dsh@<version> matching the local runtime version.

Version management: GET /remote-sessions/runtime/status reports runtime/node/bundle and upgradeability for each machine; POST /remote-sessions/runtime/ensure and POST /remote-sessions/runtime/upgrade operate on a single machine. Upgrades are refused if remote sessions are still running (ACTIVE_WORK_PRESENT) or if the socket cannot be verified/supervised via the recorded PID (ACTIVE_WORK_UNVERIFIABLE, RESIDENT_UNSUPERVISED); it only stops that PID, then re-provisions and restarts, after which old bindings fail closed like any remote process restart. You can set autoSetup: false on a machine to completely disable auto setup; npmInstall: false prohibits remote npm installation.

Lifecycle-related fields (remoteCli, remoteHome, residentProfile, runtimeDirectory, dshVersion, autoSetup, npmInstall) are not part of execution authority; changing only setup fields keeps existing bindings pinned to their identity.

Remote Web Button

The settings page Web button opens a machine-scoped web bridge profile (rs-web-<machine>): combines the resident’s session/attachment/credential store and synced model directory on the remote to run a Web UI. Sessions, models, and credentials are consistent on both sides—sessions created in the bridge Web appear in the local workspace via list adoption, and sessions created locally also appear in the bridge.

Manual YAML

Handwritten configuration is still supported (validated and persisted by the same machine-registry logic used by the settings page):

- id: remote-sessions
  config:
    machines:
      - name: build-host
        ssh: [user@build-host]
        remoteNode: /usr/bin/node
        socketPath: /home/user/.dsh/rs-runtime/agent.sock
        remoteCwd: /srv/project
        authorityRevision: '1'
    workspaces:
      - localPath: /absolute/local/remote-project-anchor
        target: build-host
        remotePath: /srv/project

Please use canonical absolute paths; do not use symlink aliases; more specific configured roots take precedence. If the remote root is a symlink, the backend resolves the mapping root to canonical form at startup, treating both spellings as the same directory.

The Version 0.8.10 status note in the materials states: Source code is implemented, tested on DSH 0.2.0-rc.2 with isolated real runtimes, and verified end-to-end (provisioning, model/credential sync, session proxy, file tree, terminal, upgrade, and restart flows) via strict SSH on live remote hosts. The npm package version is subject to the release page (the package.json in the materials shows 0.8.11).

Installation & Enablement

Install within a DSH profile (the plugin is backend-only, native UI remains unchanged):

dsh plugin --profile web add dsh-remote-sessions     # or: --profile desktop

Then restart the runtime for that profile, open Settings → Remote Sessions to add machines. The command above is the official channel; the materials also list:

  • npm: npm install dsh-remote-sessions inside the profile, or pin version with dsh plugin --profile web add npm:dsh-remote-sessions@0.8.3.
  • GitHub: dsh plugin --profile web add github:atlas5301/dsh-remote-sessions (releases correspond to published versions).
  • Plugin Hub: Search dsh-remote-sessions in DSH Plugin Hub or Settings → Plugin Hub to install from the directory.

Environment Requirements (from the materials):

  • Local and remote hosts both need DSH 0.2.0-rc.2 or higher (0.2.x)
  • Node 22.15+
  • SSH must support non-interactive authentication (key or agent), and the logged-in user must be the same Unix user owning the runtime directory.

Typical Usage

  1. Install the plugin and restart runtime as described in the previous section.
  2. Go to Settings → Remote Sessions, add a machine (Name + SSH target), click Detect to fill in Node/DSH/path defaults.
  3. Click Start to complete the first resident setup (or rely on the automatic flow when opening a workspace for the first time).
  4. In Remote workspaces, use Open remote workspace to select a remote directory (recommend something like ~/dsh-workspaces/<name> per project; not recommended to use the entire home directory as the remote workspace root, otherwise the resident sandbox lacks cross-workspace write isolation).
  5. In the native workspace, start sessions, view file trees, and open terminals as usual; use Web in the settings page for that machine to open the bridge if needed, interoperating with the local list.

Remote runtime versions can be viewed in settings or via API (/remote-sessions/runtime/status, etc.); perform Upgrade when there is a bundle update and no active remote work.

Use Cases & Notes

Suitable for: Users who want to operate AgentLoop on remote real directories within the same set of DSH native interfaces; needing strict SSH, resident lifecycle, and persistent binding; mapping management for multiple machines and multiple workspaces per machine.

Notes:

  • The plugin runs as a backend within the local DSH profile runtime, launching SSH, writing local anchors, and configs with current dsh process privileges; please read the source code and the repository LICENSE before installing to assess the trust boundary yourself.
  • SSH must be passwordless (or agent) and the user must match the owner of the remote runtime directory, otherwise detection and setup cannot be automated.
  • Community directories SkillHub and DSH Plugin Hub are ecosystem sites and have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem philosophy is “everything is a plugin,” this article only introduces the capabilities stated in the materials for this plugin.

Conclusion

dsh-remote-sessions consolidates remote DSH into “local metadata + backend proxy + strict SSH resident”. Sessions, file trees, and terminals still utilize the unchanged native UI, supporting managed workspaces via settings, runtime upgrades, and machine-scoped Web bridges. For further details, see the GitHub README (including Chinese README) and the SkillHub plugin page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye