dsh-remote-agent: Turn the secondary machine into a DSH remote Agent colleague

Preface

Running agents in DSH typically centralizes the model, session logs, and credentials on the main computer. When attempting to move builds, batch file modifications, or long-running Agent loops to another machine, two common issues arise: either the entire workspace must be synced back to the host, or if the host is powered off or disconnected, tasks on the secondary machine become uncontrollable.

This article introduces the community plugin dsh-remote-agent (maintainer zbzbhs, category: Workflow). It clarifies the boundary between the host (Hub) and the sub-machine (Worker): the Worker possesses an independent DSH and Agent loop, and tasks persist locally on the Worker; the Hub only receives handoff result cards and artifact lists, explicitly pulling the final products only when needed.

What is this?

dsh-remote-agent is a remote execution and workflow plugin for DeepSeek Harness. The current package version is 0.9.11 (MIT License, ~3 stars on GitHub; installable from the SkillHub directory page).

Architecturally, the main computer acts as the hub, retaining the model, sessions, and credentials. The plugin provides 19 remote_* tools and a web dashboard (sidebar “Remote Colleagues”); the secondary computer acts as the worker, actively dialing in (via direct or relay), running tasks within the configured roots workspace, with intermediate artifacts remaining on the Worker.

The README indicates: End-to-end usability between Hub and Worker; the exec and agent dual-paths have been verified on real hardware. It depends on zero external npm packages, using only built-in node: modules; Node requirement is ^22.19.0 || >=24.0.0; verified on DSH Desktop / CLI 0.2.0-rc.2. Platform-wise, it is fully verified on Windows, with CI coverage for Linux / macOS.

Core Functions

Task Dispatch & Scheduling

The plugin supports two task modes:

Mode Description
exec Directly execute commands in the Worker workspace (e.g., npm run build, git pull)
agent Launch an independent Agent session on the Worker, self-planning, calling tools, and writing files

exec defaults to two-stage approval (approval: 'manual') to avoid misdispatching dangerous commands. A dry-run is available before dispatch to preview the routing node, model, directory, and expected artifacts. The Worker reports git repository information under roots, facilitating repository-aware scheduling via remote_task({ repo: 'my-project' }); if no node is specified, selection can be based on CPU/memory load. Default timeouts vary by mode: 10 minutes for exec, 1 hour for agent; the Worker maxConcurrent defaults to 4, with excess tasks queued.

Result Return & Artifact Pulling

Upon task completion, a handoff result card is returned: result summary, workspace changes, list of finished products, and exit codes. It does not transfer the entire directory back to the Hub. Workspace files are classified as final / intermediate / other; only final files can be pulled via remote_pull (supporting globs and resumable transfers). The dashboard provides diffs of changes before and after the task.

Read-only Browsing of Worker Files

remote_ls, remote_read, remote_grep, and remote_tree use separate fs/req↔fs/res frames; they do not enter the task queue or occupy concurrency slots. Paths are restricted to the node’s roots, with denyPaths and symlink policies enforced as described in the README.

Connection, Security & Diagnostics

  • Since 0.9.3, the plugin opens its own listener, defaulting to port 19387. Workers dial the plugin port, no longer relying on the DSH webserver, nor requiring a host entry in cordis.patch.yml. The listen address is selected automatically: listenHost (if configured) > Tailscale IP > LAN IP > Loopback; 0.0.0.0 is rejected (newer DSH versions strictly reject wildcard addresses).
  • Disconnection does not terminate Worker tasks; task/sync reconciles after reconnection, and completed tasks are not re-run. In relay mode, business frames use X25519 + AES-256-GCM; the Worker verifies the Hub’s ed25519 identity, and the pairing code carries the fingerprint.
  • Credentials do not leave the Worker: The protocol does not transmit model keys; the Worker runs its own loop using local model configurations.
  • The dashboard provides environment health checks, connection attempt logs, error translation, and external tool detection (Tailscale / PowerShell / git / Node.js, etc.); file-writing operations on the Worker require confirm: "yes". SMB “Workspace Sharing” allows mapping drives to open with a local IDE, but this bypasses roots boundaries, defaults to read-only, and requires secondary confirmation.

The bundled cordis patch defaults to role: auto (becomes the Hub if hubUrl is not configured); simply restart DSH after installation to activate it.

Installation & Activation

The SkillHub community directory (with no official affiliation with DeepSeek / HF Trading) provides an entry for this plugin, with the version aligned to GitHub as v0.9.11. After installing the plugin in DSH, it is typically located in the DSH plugin path under the user directory, for example on Windows:

%USERPROFILE%\.dsh\dsh_orb\dsh-plugin\dsh-remote-agent\

Both machines must install the plugin and restart DSH. Then, choose any pairing route (Zero Terminal / Wizard / Manual); the destination is the same.

It is recommended to run the configuration wizard in the plugin’s bin/ directory (it generates nodeToken, pairing codes, and YAML, and handles the required inject: [] for the Worker):

node bin/dsh-remote-setup.js

On Windows, if you prefer not to open a terminal, you can double-click setup.cmd in the same directory and press Enter throughout; the Hub can also generate and copy a pairing code (including firewall instructions) with one click in the Web dashboard’s “Worker Access” section.

Wizard highlights:

  1. Hub: Select “1=Hub”, obtain the dshra1://… pairing code and complete configuration.
  2. Worker: Select “2=Worker”, paste the pairing code; the wizard will first probe the Hub’s port. The Worker can also simply write a line pair: '<pairing_code>', or explicitly override with hubUrl:.
  3. After restarting DSH on both machines, ask in the Hub conversation: “Which nodes are online on the Worker?”—if online, it is ready.

Non-interactive example (from original materials):

node bin/dsh-remote-setup.js --role worker --hub-url 192.168.1.10:19387 --token nt_xxx --roots D:\work --node-id slave-pc

If issues arise, run a health check on the config file:

node bin/dsh-remote-setup.js --doctor your-config.yml

Typical Usage

Confirm Node Online: After installation and pairing, use natural language or remote_* tools to view Worker nodes and load (the dashboard displays CPU/Memory badges).

Dispatch exec Task: Submit commands via the dashboard or tools; manual approval is required by default before execution; use dry-run first to confirm routing and directory.

Dispatch agent Task: Let the Worker run an independent Agent under specified roots; the Hub can specify the Worker’s model in the dashboard’s “Model” section (if left blank, the Worker’s default is used).

Repository-based Scheduling: After the Worker reports git repositories, use the repo parameter in remote_task to point to the repository name.

Retrieve Products: After the task ends, view the handoff card and final list, then pull as needed via remote_pull; during long-running tasks, read-only file tools can still be used to view Worker directories.

Cross-NAT: Use direct for the same LAN or Tailscale; if both parties are behind NAT, deploy dsh-remote-relay (provided in the package as bin/dsh-remote-relay.js).

Use Cases & Precautions

Suitable for: Centralizing conversation and credentials on the main computer, but wanting compilation, crawling, or long-running Agents to run on a desktop/old laptop; selecting workers based on load or repository in a multi-machine setup; scenarios where only summaries and finished products are needed without syncing the entire node_modules and logs.

Precautions:

  • The plugin runs with the current DSH process permissions. Please read the source code and MIT license before installation, and understand the risk surface of exec / file writing / SMB sharing.
  • The Worker must correctly configure inject: [] (the wizard fills this in), otherwise it may silently fail to go online.
  • The Hub listener must not bind to 0.0.0.0; if bound only to loopback, the Worker cannot connect, and the dashboard will show a reachability warning.
  • One-click repair modifies DSH’s cordis.patch.yml managed block; the flow is Preview → Confirm with confirm: "yes" → Automatic backup.

Conclusion

dsh-remote-agent consolidates “remote computing power” into the DSH workflow: Workers persistently run tasks and Agents locally, while the Hub only holds the handoff and artifact list, pulling files only when necessary. Community directory and repository:

  • Directory Page: https://www.skillhub.cn/plugins/zbzbhs/dsh-remote-agent
  • GitHub: https://github.com/zbzbhs/dsh-remote-agent
羽毛球分组比赛记分
小程序二维码

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

Xiaoye