Restart DSH Service with One Click in Settings → General

Foreword

DSH’s extension mechanism is plugin-oriented, with many UI entry points and host capabilities mountable through plugins. For users of the web profile, having to switch back to the terminal just to restart the service adds an extra step to the workflow. dsh-setting-restart provides a one-click restart entry within the general settings page: a “One-Click Restart” row appears at the bottom of Settings → General, which, when clicked, triggers a DSH service restart and automatically reconnects from the browser.

Below, we cover its positioning, core functionality, installation and enabling instructions, typical usage, and configuration considerations.

Plugin Positioning

dsh-setting-restart is a DSH plugin maintained by 893413974-bit, licensed under MIT. It targets developers who already use the DeepSeek Harness web profile, bringing the restart action into the settings page to reduce switching between the browser and terminal.

Runtime requirements are as follows:

  • DeepSeek Harness dsh ≥ 0.1.0-rc.6 (web profile)
  • Node.js ≥ 20

Core Features

  • Provides a “One-Click Restart” row at the bottom of the Settings → General page.
  • The restart row is pinned to the very bottom of the page using the maximum slot order.
  • The restart is an actual process restart: the host launches a detached helper, and after exiting, the helper relaunches the same dsh command.
  • Browser tabs automatically reconnect once the new instance binds to the same port.
  • Offers bilingual UI text in Simplified Chinese / English.
  • Performs a strict RPC call to settingRestart/restart via the DSH Typert RPC registry.

Installation and Enabling

  1. First, install into the web profile:
dsh plugin --profile web add dsh-setting-restart
  1. Add an insert entry to the user patch layer for the profile. Add the following entry to $DSH_HOME/profiles/web/cordis.patch.yml:
# $DSH_HOME/profiles/web/cordis.patch.yml
- insert:
    - id: setting-restart
      name: dsh-setting-restart
  1. Start or restart the service:
dsh web
  1. Open Settings → General and confirm the “One-Click Restart” row appears at the bottom of the page. After clicking “Restart”, the service goes through the restart flow described above, and the page automatically reconnects once the new instance binds to the same port.

If you want the same plugin to take effect for all profiles, you can also add the same patch to the home-level $DSH_HOME/cordis.patch.yml.

Typical Usage

First, run dsh web to start the service. Then open Settings → General, and the “One-Click Restart” row will appear at the bottom of the page.

After clicking “Restart”, the host launches a detached helper and then exits the current process; the helper relaunches the same dsh command. Once the new instance binds to the same port, the original browser tab automatically reconnects.

Configuration

The insert entry supports an optional config block. The example below shows the configurable options and their default values:

- insert:
    - id: setting-restart
      name: dsh-setting-restart
      config:
        exitDelayMs: 1200
        waitForExitMs: 30000
        respawn: true
  • exitDelayMs defaults to 1200.
  • waitForExitMs defaults to 30000.
  • respawn defaults to true; if the service is already automatically restarted by a supervisor like systemd or pm2, you can set it to false.

Applicable Scenarios and Notes

Suitable for the following scenarios:

  • You already use the DSH web profile and want to restart the service from within the browser settings page.
  • You need a fixed restart entry at the bottom of Settings → General.
  • The service is not managed by an external supervisor, and you want the plugin to handle the actual process restart and automatic reconnection.

Things to keep in mind:

  • The plugin runs with the permissions of the current dsh process; inspect the source code, interfaces, and license before installation.
  • If you already have a process supervisor like systemd or pm2 managing the process, it is recommended to set respawn to false to avoid duplicate launches.
  • Before use, ensure your environment meets the version requirements of dsh ≥ 0.1.0-rc.6 and Node.js ≥ 20.

Conclusion

The value of dsh-setting-restart lies in consolidating DSH service restarts into a general settings page: a fixed entry point, clear actions, and automatic page reconnection. GitHub repository: https://github.com/893413974-bit/dsh-setting-restart.

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

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

Xiaoye