dsh-relay-client: Letting DeepSeek Harness Sessions Talk to Each Other

Introduction

When running multiple parallel development sessions in DeepSeek Harness (DSH), passing messages between sessions is usually cumbersome: you end up writing them in GitHub issues, in shared files, or manually copy-pasting. This plugin turns cross-session, cross-machine messaging into a single tool call, without needing to leave the current session.

What It Is

dsh-relay-client is a DSH plugin maintained by chenvinc, categorized under “Workflow.” It implements messaging between sessions and between sessions and machines via the control plane provided by a locally running pcpanel. The plugin does not modify the DSH core, nor does it patch other plugins—it simply bundles itself into the profile.

Core Features

  • relay_bind: Binds the current session to a logical name, such as po, fe, or macbook/dsh-proj/backend.
  • relay_unbind: Unregisters an alias for the current session.
  • relay_forget: Removes a known node from the directory.
  • relay_send: Sends a message to another session, supporting unicast to and carbon-copy cc, with optional type and thread fields.
  • Auto-injection: A background poller checks the local panel’s inbox and automatically injects incoming messages into the target session, following the Agent.followup → steer → inbox three-level fallback.
  • Three-level addressing: Addresses follow the format machine / workspace / alias. Cross-machine delivery is handled by the panel’s federation layer; the plugin itself only connects to the local machine.
  • State persistence: Bindings are written to ~/.dsh/state/relay-client/state.json (overridable via RELAY_CLIENT_STATE_DIR) and automatically restored on restart.
  • HTTP endpoints: Exposes two local endpoints for panel or curl interactions:
  • GET /relay-client/status: Current bindings and connection status
  • POST /relay-client/bind / /unbind: Explicit bind/unbind (requires session_id)

Prerequisites

A locally running pcpanel is required, providing the /api/relay/* control plane (default address: http://127.0.0.1:8765). For cross-machine communication, the remote side must also run a panel, discover each other automatically via UDP 8766, and register each other in the directory. Without a panel, the plugin can still load, but relay_send will fail.

Installation & Activation

  1. Navigate to the DSH profile directory (example path):
   cd ~/.dsh/profiles/web
  1. Install the plugin:
   pnpm add dsh-relay-client   # or npm install dsh-relay-client
  1. Add dsh-relay-client to dsh.profile.bundles in that profile’s package.json.
  2. Fill in base / machine_id / workspace in cordis.patch.yml (see the installation docs for detailed steps).
  3. Ensure machine_id exactly matches the local panel’s config.relay.machine_id; otherwise, cross-machine three-level addressing will fail.

Typical Usage

Invoke the tool within a session:

You: Bind a name, then tell the backend session that the API contract is finalized.
Agent: (calls relay_bind to bind as "po")
Agent: (calls relay_send, to=backend, type=contract, content=...)

Tool list:

  • relay_bind: Binds the current session to a logical name (automatically uses the current sessionId when called within a session).
  • relay_unbind: Unregisters an alias for the current session.
  • relay_forget: Removes a known node from the directory.
  • relay_send: Sends a message, supporting to / cc three-level addresses, type, and thread.

Design Trade-offs

  • Control-plane / data-plane separation: The panel handles the registry, addressing, and audit; message injection goes through DSH’s native Agent.followup—no new messaging kernel is introduced.
  • Explicit identity binding: The background timer has no access to the current session, so the logical name must be declared by the session itself via relay_bind, or explicitly passed through the HTTP endpoint.
  • Persistent, recoverable state: Bindings are written locally to ~/.dsh/state/relay-client/state.json and automatically restored on restart.
  • No token authentication on the LAN (consistent with the panel). For public-facing access, add your own reverse proxy and authentication.

Verification

npm test              # 64 mock tests (no real DSH / panel required)
npm run test:integration   # Real end-to-end path; requires a running pcpanel relay service

Use Cases & Cautions

Ideal for developers who need to pass structured messages between DSH sessions or across multiple machines on the same local network. The plugin runs with the current DSH process’s permissions; review the source code and license before installing.

Summary

dsh-relay-client turns cross-session and cross-device messaging into a single tool call—no need to leave the current session. It leverages pcpanel as the control plane, supporting three-level addressing, automatic injection, and state persistence. It’s well-suited for scenarios that require messaging capabilities within DSH workflows.

  • Plugin directory: https://www.skillhub.cn/plugins/chenvinc/dsh-relay-client
  • Source repository: https://github.com/chenvinc/dsh-relay-client
羽毛球分组比赛记分
小程序二维码

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

Xiaoye