Introduction

When using DeepSeek Harness (DSH) in a Windows environment, restarting the service is a common operation. In the usual approach, if the watchdog process behaves abnormally or port probing fails after a restart, DSH may fail to recover automatically, causing conversations to be interrupted.

mandarin715/dsh-autostart is a Windows-only DSH plugin. It takes over the restart logic through a persistent watchdog process, resolving the issue of “restart failures causing DSH to halt.” It also provides a console-window-free runtime and supports one-click auto-start on boot.

Core Features

  1. One-click auto-start: Automatically runs at startup by writing to the registry.
  2. One-click restart with guaranteed recovery: If a restart fails, the plugin refuses to shut down DSH, ensuring the service remains online.
  3. Persistent watchdog process without a console window: DSH starts attached to a hidden console, avoiding pop-up windows.
  4. Service status monitoring and port probing: Probes service status in real time.
  5. Hook script support: Allows custom scripts to run after the service starts.
  6. Registry autostart management: Manages reading and writing autostart entries.

Installation and Enablement

Install the plugin via the command line:

dsh plugin --profile web add "github:Mandarin715/dsh-autostart#v0.2.1"

After installation, restart DSH, go to “Settings → General Settings”, and find the plugin card at the bottom of the page.

  1. Click “Enable Autostart” to write the configuration to the registry HKCU\...\Run.
  2. Click “Restart Service” on the card to test it.

Configuration

Plugin configuration is located in the cordis.patch.yml file under the profile:

- id: dsh-autostart
  name: dsh-autostart
  config:
    hookScript: ''                 # 可选,服务起来后执行的脚本绝对路径
    dshPort: 3080
    allowedHosts: []               # 必须显式填写,如 ['derp.example.com']

Important note: Configuration items such as hookScript are snapshotted into the configuration file when autostart is enabled. Therefore, after modifying configurations (such as hookScript), you must click “Enable Autostart” again in the settings page for changes to take effect.

Regarding allowedHosts: By default it is an empty array, meaning no non-loopback Host is trusted. If accessing via a reverse proxy, you must explicitly add the domain to the whitelist; otherwise write operations will be rejected.

Notes

  • System limitation: Windows only.
  • Runtime environment: Requires Node.js >= 20 and DSH >= 0.1.0-rc.6.
  • Agent impact: Restart interrupts any running Agent turn; results may not have been persisted.
  • Configuration effect: Configuration changes require re-enabling autostart.
  • Restart fallback: If a restart fails, DSH is not shut down, but race conditions may occur (simultaneous startup with other autostart items).
  • Security software: Registry writes may be blocked by security software, causing “Enable Autostart” to fail.

Brief Ending

This plugin solves the pain point of unreliable DSH restarts in Windows through a persistent watchdog mechanism. After installation, you need to re-enable it in the settings page to apply the configuration. For more details, see the project directory page or the GitHub repository.