dsh-restart-button: Adds one-click restart for the DeepSeek Harness desktop app

Introduction

After installing plugins or modifying profiles in DeepSeek Harness (DSH), it is often necessary to make the desktop process re-run the configuration. The official packaged desktop application itself has almost no entry point to “restart itself”: the tray menu only offers Open and Quit; although there is a Restart App and Host function in the code, it is blocked from production builds by development = !app.isPackaged; closing the window only minimizes it to the tray rather than quitting. The common workaround is to select Quit from the tray and then find the icon to launch it again. The following introduces the community plugin dsh-restart-button (Maintainer: FIZMIE, Category: Client), which adds a refresh button to the sidebar brand row and exposes an HTTP route, allowing agents or scripts to trigger a restart.

What is this

dsh-restart-button is targeted at the DeepSeek Harness Desktop version: a small refresh button appears to the right of the DeepSeek Harness wordmark in the sidebar. After clicking and confirming, the entire application restarts; simultaneously, it mounts POST /dsh-restart-button/restart, allowing agents to request a restart without clicking the UI.

The DSH ecosystem is “everything is a plugin”; community directories like SkillHub have no official affiliation with DeepSeek / High-Flyer. This article is based solely on the README and package information of the repository mentioned above.

Environment and Prerequisites

Item Requirement
OS Windows (Restart worker uses WMI, wscript.exe, and Win32 foreground activation)
Host DeepSeek Harness Desktop Build 0.2.0-rc.2
Profile Patch Mandatory — See Installation Step 1 below; without this, the plugin can be installed and HTTP works, but the button will not appear

The Node engine requires >=22.6 (see package.json).

Core Features

  1. Sidebar Brand Row Button — A refresh icon sits next to the wordmark. After confirmation, the window disappears, the process restarts, the window returns to the foreground, and the page reloads.
  2. HTTP Route — Prefix /dsh-restart-button, for use by scripts or Agents.
  3. Diagnostics and Logging — GET /status, GET /health; the restart process writes to $DSH_HOME/.dsh-restart-button/restart.log.

The sidebar brand row is a single slot in Cordis: registering a second time to the same single slot will throw an error. Therefore, the official placeholder @deepseek-ai/dsh-client-ui-brand-official must be disabled first; this plugin redraws the official wordmark, keeping the title’s appearance unchanged.

Installation and Activation

1. Append Profile Patch (Must be done first)

Append the following snippet to $DSH_HOME/profiles/<profile>/cordis.patch.yml (see the repository install/profile-patch.yml for full instructions):

- id: ui-brand-official
  name: "@deepseek-ai/dsh-client-ui-brand-official"
  disabled: true

ui-brand-official is the line id declared in @deepseek-ai/dsh-web-app/cordis.patch.yml.

2. Install Plugin Bundle

A DSH plugin is a profile bundle. Choose one of the following (from the README):

# From Git repository
dsh plugin --profile desktop add git+https://github.com/FIZMIE/dsh-restart-button.git

# From local directory
dsh plugin --profile desktop add C:\path\to\dsh-restart-button

3. Refresh Page

Client changes are hot-updated by dsh-client-modules; simply refreshing the browser is enough without restarting the process first. The button should appear to the right of the wordmark.

HTTP API and Typical Usage

All routes are mounted under the host Web service:

Method Path Purpose
GET /dsh-restart-button/status Process identity, executable path, restart availability
GET /dsh-restart-button/health bootId and uptime; poll from the browser side to detect a new process
POST /dsh-restart-button/restart Schedule a restart, returns 202 before the app exits

POST /restart only accepts loopback sources, and the request must carry the app’s own origin or a local token (written to $DSH_HOME/.dsh-restart-button/token). Common token header usage for Agents:

$token = (Get-Content "$env:DSH_HOME\.dsh-restart-button\token" -Raw).Trim()
Invoke-RestMethod -Method Post -Uri "http://127.0.0.1:19387/dsh-restart-button/restart" `
  -Headers @{ 'X-DSH-Restart-Token' = $token }

(Port 19387 is an example from the README; use the actual listening port of your current DSH host.)

Implementation Details (Why a separate worker is needed)

The desktop shell (Electron main) launches the DSH host and plugin subprocesses with ELECTRON_RUN_AS_NODE=1; plugins cannot call app.relaunch(), and existing IPC only has ready with no “please restart” message. Therefore, the restart must be completed by a helper outside the process tree.

Early helpers acting as application subprocesses were destroyed along with the application’s Job object. The current approach uses WMI Win32_Process.Create to duplicate itself, changing the parent process to WmiPrvSE.exe, then relaunching and foregrounding the window after the old process exits; it also uses wscript.exe + .vbs to launch the worker windowlessly. The README also documents pitfalls related to GUI .spawn on Windows such as ELECTRON_RUN_AS_NODE, windowsHide, and detached, as well as using the Web port responding again as the criterion for “restart complete”. Logs and retry limits (5 times) can be found in $DSH_HOME/.dsh-restart-button/restart.log.

Use Cases and Notes

Suitable for: Windows users of the DSH Desktop version who frequently modify plugins or profiles and want one-click or automated restarts instead of using Tray -> Quit every time.

Important Notes:

  • The plugin runs under the current DSH process permissions; please review the source code and MIT license yourself before installing.
  • On non-Windows systems or without the profile patch applied, capabilities will differ from the README description (e.g., no button).
  • Reverting the brand patch restores the official @deepseek-ai/dsh-client-ui-brand-official (see the revert instructions in install/profile-patch.yml in the repository).

Conclusion

dsh-restart-button fills the gap in the packaged desktop version’s missing self-restart entry: restart with one click in the sidebar, combined with a tokenized POST /restart for Agents. The installation order is Profile Patch → dsh plugin add → Refresh Page.

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

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

Xiaoye