dsh-restart-button: One-click restart of dsh web in the DSH Web interface

Preface

When using DeepSeek Harness (DSH) as a local AI workbench, installing plugins, editing cordis.patch.yml, or debugging link: local packages usually requires restarting dsh web to take effect. The common approach is to go back to the terminal, hit Ctrl+C, then run dsh web again, and manually refresh the browser; after the restart, the connection token changes, the page may return 401, and you have to log in again. If DSH was launched in the background without a console via .vbs / .bat, there may be no terminal available to stop the process.

Below is a community plugin dsh-restart-button (maintainer xinshang777). It injects a “↻ Restart” button into the top-right corner of the DSH Web page, collapsing “stop service → start again → refresh/re-login” into a single click, and automatically redirects to the URL carrying the new token once the new process is ready, so as to preserve the login state as much as possible.

What This Is

dsh-restart-button is a client-side plugin for DSH (current version 0.1.0, license MIT). It adds no new business configuration items; its behavior is determined by DSH’s own startup parameters (e.g. --port).

In one sentence: it turns “go back to the command line, Ctrl+C, then rerun dsh web, and manually refresh the browser” into a single click on the web page; during the restart the assistant reuses the original port and passes --no-open to the new process to avoid popping up a new tab.

The plugin runs with the permissions of the current dsh web process. Before installing, it is recommended to read the source code and license on the GitHub repository to confirm it meets your environment and security requirements.

Core Features

Capability Description
UI button Injects ↻ Restart between [ Theme ] and [ Settings ] (requires a hard refresh of the page to be visible)
Local restart Triggered via POST /dsh-restart/restart; the old process exits after about 250ms, the detached assistant polls the port and then launches a new dsh web on the original port
Automatic access recovery The frontend polls /dsh-restart/status, and upon getting the new bootId and the URL carrying the token performs location.replace, reducing post-restart 401s and manual logins
Security boundary The restart API only allows loopback access from the local machine (127.0.0.1 / localhost, etc.); non-loopback addresses receive 403, which is intentional design
No remote entry Does not access the network, does not read account files; does not send requests outside the local machine

What this plugin does not do: process daemonization or crash self-healing (it only restarts once when you click), auto-start on boot, port conflict detection; it also does not expose restart capability under remote access.

Installation and Activation

Prerequisites

  • Node.js ≥ 18 (the plugin uses node:net / node:child_process)
  • pnpm (the remaining arguments of dsh plugin are forwarded to pnpm as-is; if missing, run npm i -g pnpm)
  • @deepseek-ai/dsh installed, and dsh web can run normally
  • Access the Web UI via http://127.0.0.1:<port> or http://localhost:<port>

Run in the terminal:

dsh plugin --profile web add github:xinshang777/dsh-restart-button

After successful installation, the plugin is registered in the profile’s dsh.profile.bundles (~/.dsh/profiles/web/package.json); no manual configuration edits are needed.

After the first installation, you still need to manually restart dsh web once; from the second time on, most scenarios that require a restart can be handled with the page button.

Other Installation Methods (As Needed)

  • Local development / source modification: in the cloned repository directory, run dsh plugin --profile web add link:. (changing lib/* requires a restart; changing assets/client.js only needs a hard refresh).
  • Offline / version pinning: download and unzip the ZIP, then in that directory run dsh plugin --profile web add link:., and restart dsh web.

Verifying Installation

  1. Start dsh web, and perform a F5 or Ctrl+F5 hard refresh in the browser.
  2. ↻ Restart should appear in the top-right corner (to the left of “Settings”).

If you cannot see the button: check whether bundles includes dsh-restart-button → hard refresh → then fully restart dsh web once more.

Typical Usage

  1. Find the button — Open DSH Web at the local loopback address, hard refresh, and look at the top-right [ Theme ] [ ↻ Restart ] [ Settings ].
  2. Click restart — The button enters “Restarting”; no commands need to be typed on the browser side. Flow overview: page POST /dsh-restart/restart → old process exits and launches the assistant → assistant starts the new process on the original port → page polls status → automatically redirects to the URL carrying the new token.
  3. Confirm success — The page reloads and does not require re-login, which means success.
  4. When you need to click — When installing/uninstalling plugins, modifying ~/.dsh/profiles/web/cordis.patch.yml, or modifying the host-side code of link: plugins (lib/*); merely chatting or switching sessions does not require it.

This plugin does not read the config: in cordis.patch.yml. If you change the DSH startup port, you should change the dsh web startup command (e.g. --port); during a restart the assistant reuses the port of the current process.

Use Cases and Notes

Who It Is For

  • People who frequently install plugins and change configuration, for whom restarting dsh web is a daily operation.
  • DSH started in the background without a terminal, so the service cannot be stopped with Ctrl+C.
  • People tired of post-restart 401s, manual refreshes, or re-logins.
  • People modifying plugin source with link:, needing an in-browser closed loop of “change once → restart → verify”.

Who It Is Not For

  • People who almost never restart DSH.
  • People deploying DSH on a remote server for others to access via LAN IP, domain, or reverse proxy — clicking the button will get 403 in this case; for remote scenarios it is advisable to use SSH and manage restarts yourself with pm2 / systemd, etc.

FAQ (Brief)

Symptom Handling
403 forbidden Switch to accessing via 127.0.0.1 or localhost; this is not a bug
500 dsh bin.js not found Try to use the official dsh web to start; avoid unusual entry paths
Still need to log in after restart Confirm the official connection layer; if a custom connection layer causes authenticatedUrl to be unavailable, it may degrade to a plain refresh
405 The restart API only accepts POST; do not open /dsh-restart/restart directly in the address bar

Upgrading and Uninstalling

To upgrade (GitHub method), you can rerun the install command; for the link: method, after git pull, just click the restart button once.

Uninstall:

dsh plugin --profile web remove dsh-restart-button

The plugin does not leave behind independent configuration files; after uninstallation the route disappears, and restarts need to go back to the command line (or modify package.json and manually restart).

Closing

dsh-restart-button targets local DSH Web users, collapsing restart and login recovery into a single button, and is especially suitable for plugin development and frequent configuration-change scenarios. The DSH ecosystem emphasizes “everything is a plugin”; the community directory SkillHub is an independent site, with no official affiliation with DeepSeek / High-Flyer.

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

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

Xiaoye