Introduction

In DeepSeek Harness (DSH), installing plugins or modifying the profile bundle typically requires restarting the entire desktop process to load the new code. However, the desktop interface lacks a visible “Restart” entry. The common workaround is to quit from the system tray and reopen the application—a multi-step process that is easily confused with simply “closing the window,” as closing the main window often merely hides it in the tray.

dsh-restart is a community-maintained client plugin that adds a “Restart” button next to “Apply” and “Edit” in the Windows title bar. It uses a two-click mechanism to trigger a full restart, allowing newly installed plugins to take effect as quickly as possible. The following section covers its positioning, behavior, installation methods, and usage boundaries.

What is this

  • Name: dsh-restart (Repository: csuwzw/dsh-restart)
  • Maintainer: csuwzw
  • Category: Client (Title bar UI + Host API)
  • License: MIT; The version referenced in current materials is 1.0.2
  • Platform: Windows Desktop only; README confirms validation on DSH kernel 0.2.0-rc.2

The plugin does not modify the kernel: it has zero dependencies, requires no build steps, and mounts host-side routes and browser-side buttons via the profile bundle.

Core Features

Two-Click Restart via Title Bar

The button is positioned immediately to the right of “Apply” and “Edit.” Its styling is attached within the shadow DOM of the preload menu bar, matching the height, padding, and hover state of adjacent menu items; the interface text follows the <html lang> attribute.

  1. First Click: The text changes to “Confirm restart?”; if not clicked again within 4 seconds, it automatically cancels.
  2. Second Click: Displays “Restarting…” and becomes disabled; the old instance is terminated, and a new instance is automatically launched.

The README states that the interface returns to a usable state after approximately 9 seconds. Since the restart terminates running tasks, a two-step confirmation is adopted.

Host-Side Restart Path

The trigger is initiated by the browser via POST /api/dsh-restart/restart (requires the custom header x-dsh-restart-action: restart and only accepts local loopback origins to mitigate CSRF risks). After receiving the response, the host launches restart.ps1 via WMI after a delay of approximately 300ms. This separates the restart script from the DSH job object, preventing the old process from taking its child processes with it upon exit.

The script wraps PowerShell using conhost.exe --headless to avoid popping up an unclosable console window when the default terminal is Windows Terminal. Steps are written to $DSH_HOME/logs/dsh-restart-plugin.log; the success criterion is that the new instance’s Host subprocess begins listening, rather than relying on a fixed port number (since the desktop version often starts with --port 0).

Installation and Activation

Prerequisite: DeepSeek Harness Windows Desktop Version.

The desktop version can manage the desktop profile via @deepseek-ai/dsh-desktop-host/lib/cli.js. Run the following in cmd after replacing the installation path with your local directory (Example from source material: pins the v1.0.2 codeload package, does not require git to be installed locally):

set ELECTRON_RUN_AS_NODE=1
"C:\D\software\DeepSeek Harness\DeepSeek Harness.exe" --expose-internals ^
  "C:\D\software\DeepSeek Harness\resources\app.asar\dsh\node_modules\@deepseek-ai\dsh-desktop-host\lib\cli.js" ^
  plugin --profile desktop add https://codeload.github.com/csuwzw/dsh-restart/tar.gz/refs/tags/v1.0.2

README Note: Formats like github:csuwzw/dsh-restart will trigger git ls-remote, which often fails on Windows machines without git installed; to follow the latest main, you can use the codeload URL for refs/heads/main, but the version will not be reproducible.

After installation, a manual restart is still required for the title bar button to appear; subsequent restarts can be performed using the button.

Method 2: Plugin Manager in Settings

Open Settings → Plugins, enter the repository address or local directory in the installation box, and let the application’s own installation channel handle it.

Method 3: Manual Placement

Place package.json, index.js, client.js, restart.ps1, and cordis.patch.yml into <DSH_HOME>/profiles/desktop/node_modules/dsh-restart/. Add "dsh-restart": "1.0.2" to the dependencies of the profile’s package.json (do not use link:), append "dsh-restart" to the end of dsh.profile.bundles, and restart the application once. Do not register patches in cordis.patch.yml that are already included in the bundle, otherwise it will result in a duplicate loader entry error.

Post-Installation Verification

Check $DSH_HOME/logs/dsh-restart-plugin.log. If all four steps are recorded and the last line shows verdict=ok, the link is working. The example lines provided in the README include stages such as armed, taskkill, launched, and verify.

Typical Usage

Daily workflow:

  1. Install or update other plugins in DSH, or modify the bundle list.
  2. Click Restart in the title bar → Confirm again within 4 seconds.
  3. Wait for the button to show “Restarting…” and for verdict=ok to appear in the logs, then verify if the new plugin has loaded.

When developing plugins, the README reminds you: Changes to both the host side and client bundle require a DSH restart to take effect; if client HMR is not enabled, simply refreshing the page will not fetch the new version of client.js. You can run the following locally:

node client.test.cjs client.js

This performs an offline self-test on client.js (stated as 25 checks in the materials, requires Node ≥ 20).

Use Cases and Notes

Who it is for

  • Developers who frequently try out and iterate on plugins in the Windows desktop version of DSH.
  • Users who want to avoid the tray quit path and prefer a fixed UI for restarting.

Important Notes

  • Windows Only: The restart script depends on WMI, conhost.exe, and taskkill.
  • Does not wait for tasks to finish: Consistent with the desktop version’s lack of a viable graceful exit path, a restart forcibly ends current tasks.
  • No automatic retry on failure: Blindly retrying after the old instance has ended may result in duplicate instances.
  • Permissions and Security: The plugin runs with the permissions of the current DSH process; please read the source code and the MIT License before installation to confirm you accept its behavior of terminating processes and launching new instances via WMI.

The DSH ecosystem emphasizes “everything is a plugin”; the SkillHub directory page is a community collection site and has no official affiliation with DeepSeek or Higuang (Huanfang).

Conclusion

dsh-restart addresses the specific gap where “installing a plugin requires a restart, but there is no interface entry”: it offers a two-click title bar interaction, traceable logs, and isolation of the restart script from the job object. If you frequently modify plugins on the Windows desktop version of DSH, you can treat it as a fixed step in your toolchain.