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 → Generalpage. - 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
dshcommand. - 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/restartvia the DSH Typert RPC registry.
Installation and Enabling¶
- First, install into the
webprofile:
dsh plugin --profile web add dsh-setting-restart
- Add an
insertentry 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
- Start or restart the service:
dsh web
- Open
Settings → Generaland 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
exitDelayMsdefaults to1200.waitForExitMsdefaults to30000.respawndefaults totrue; if the service is already automatically restarted by a supervisor likesystemdorpm2, you can set it tofalse.
Applicable Scenarios and Notes¶
Suitable for the following scenarios:
- You already use the DSH
webprofile 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
dshprocess; inspect the source code, interfaces, and license before installation. - If you already have a process supervisor like
systemdorpm2managing the process, it is recommended to setrespawntofalseto avoid duplicate launches. - Before use, ensure your environment meets the version requirements of
dsh ≥ 0.1.0-rc.6and 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.