- Accueil
- Plugins
- Améliorations UI
- dsh-restart-button
dsh-restart-button
lightfrom/dsh-restart-button
Adds a one-click Restart action to the DeepSeek Harness sidebar: it quits the app, relaunches it, and refreshes the page once the new instance answers.
Installer
dsh plugin --profile web add github:lightfrom/dsh-restart-buttonREADME
Restart Button for DeepSeek Harness
A Restart button in the sidebar foot, next to Settings. One click quits
DeepSeek Harness and starts it again; the page reloads by itself once the new
instance answers.
Overview
DeepSeek Harness has no built-in way to restart itself from the interface: you close the window and open the application again. This plugin puts that whole sequence behind one button and keeps the browser page in the loop, so a restart feels like a page reload instead of a lost session.
The plugin is a normal DSH bundle. It can be switched off from Settings → Plugins at any time, and turning it off removes the button, its route and its styles without a restart.
Key Features
- One click, no confirmation. The button starts the restart immediately.
- The page survives. It shows
Restarting, waits for the replacement, then reloads onto the new instance. - Correct on both launch modes. The desktop application is relaunched as the
application (not as a second headless Host), and a plain
dsh weblaunch replays its own command line. Either way the old listener is gone before the replacement binds, so the restart does not end inEADDRINUSE. - Guarded endpoint.
POST /__local-restart/restartgoes through the composition's ownconnectionfence (Host/Origin plus the browser session), so another local process cannot restart your Harness. - Live switch.
enabledis the only setting; toggling it disposes or mounts the plugin row without restarting. - Bilingual. The button, the plugin card and the dictionaries ship in Simplified Chinese and English.
Screenshot
The restart action sits at the bottom of the sidebar, below the workspace list and above the account row:

Architecture
Three parts, split by what each one is allowed to do:
Browser page Host process Detached helper
──────────── ──────────── ─────────────────
click
│ POST /__local-restart/restart
├────────────────────────▶ fence check
│ spawn helper ─────────────▶ waits for the port
│ 202 Accepted to be released
│ exit │
│ poll GET /__local-restart/ping │ close the app
│ (gone) │ start it again
│ ▼
└──────────── reload ◀──────────── new instance listens ─┘
index.js(Host) registers the route and starts the helper with the invocation the replacement must use.restart-helper.mjsis detached withstdio: 'ignore', so it outlives the process it replaces. It closes the application, waits for the port, starts the replacement and logs every step.client.js(Client) registers the sidebar button and runs the wait-then-reload loop.restart-utils.mjsholds the dependency-free pieces the Host half uses: the single-flight guard (409while a restart is running), exclusive creation of the log file, and a capped body drain for authorized requests.
Project Structure
dsh-restart-button/
├── .github/workflows/ci.yml Syntax, packaging gate and tests on push
├── assets/
│ ├── icon-180.png Raster storefront icon (PNG)
│ └── restart-button-sidebar.png Screenshot used by this README
├── client.js Client half: the sidebar button and reload loop
├── cordis.patch.yml Bundle patch that inserts the plugin row
├── docs/verification.md Checks run for the 1.0.x releases and their results
├── icon.svg Plugin card icon
├── index.js Host half: guarded endpoint and helper spawn
├── locale/
│ ├── en.json Plugin card title and description (English)
│ └── zh.json Plugin card title and description (Chinese)
├── package.json Manifest: exports, dsh.bundle, dsh.client
├── restart-helper.mjs Detached helper that performs the restart
├── restart-utils.mjs Guard, exclusive log file and bounded body drain
├── scripts/verify-package.mjs Packaging gate used by `prepack`
├── test/plugin.test.mjs Structure, i18n, dependency and secret tests
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md This file
├── README_CN.md Chinese README
└── SECURITY.md
Requirements
- DeepSeek Harness Desktop, or a standalone
dshCLI. Development and the live check were done on Windows; the POSIX branches in the helper are present but have not been exercised. The packageddsh.cmdshim exportsELECTRON_RUN_AS_NODE=1, so a launch through it is classified as the desktop Host; its restart reopens the desktop application instead of replaying that CLI invocation. - Node.js 20 or newer for development and for the test suite. The plugin itself
runs inside Harness and only uses
node:builtins plus@deepseek-ai/schemastery, which Harness already provides; it is declared as a peer dependency instead of being bundled.
Installation
The plugin is not published to npm, so install it from the artifact or the repository. Every method below ends with a restart of Harness: bundle patches are composed at launch.
From the packaged tarball (recommended; pnpm add accepts a local file).
Download it from the v1.0.2 release
(the release also carries SHA256SUMS.txt and a source zip):
dsh plugin --profile desktop add ./dsh-restart-button-1.0.2.tgz
From a clone of this repository:
git clone https://github.com/Lightfrom/dsh-restart-button.git
dsh plugin --profile desktop add ./dsh-restart-button
From npm, once it is published:
dsh plugin --profile desktop add dsh-restart-button
Replace desktop with the profile you actually run (dsh --profile <name>).
Then quit and relaunch Harness. The button appears in the sidebar footer, beside Settings. If an earlier development build of this plugin is still installed under another package name, remove it first so only one restart button is registered.
To uninstall:
dsh plugin --profile desktop remove dsh-restart-button
Configuration
The row has one option:
| Option | Default | Meaning |
|---|---|---|
enabled | true | Register the button and the restart route. false leaves nothing behind. |
Settings → Plugins → Restart Button toggles the same option, live. A patch file can also set it:
- id: dsh-restart-button
config:
enabled: false
Quick Start
- Install the bundle (see above) and relaunch Harness.
- Find Restart (中文界面: 重启) at the bottom of the sidebar.
- Click it. The label changes to Restarting, the window closes, and the page reloads when the new instance is listening.
The restart takes several seconds: the application has to finish quitting before the replacement starts. The helper log records how long each step took.
Usage
- Restarting the desktop application is the primary use case: the helper closes the application through its own close path, waits for the Host port to be released, then starts the application executable again with a normal window.
- Restarting
dsh webfrom a terminal replays the original command line and working directory. The terminal that started it can be left alone. - Turning the feature off before a demo: Settings → Plugins → Restart Button → off.
API Reference
Two routes, both under /__local-restart. They are internal to the page and are
not a public API.
| Method | Path | Response |
|---|---|---|
GET | /__local-restart/ping | 200 {"ok":true,"port":51885} while the instance is alive |
POST | /__local-restart/restart | 202 with {ok, port, helperPid, log} when the restart was scheduled |
POST | /__local-restart/restart | 401 when the caller has no session credential; 405 for a non-POST method |
| any | other paths under the prefix | 404 |
POST is checked by connection.requestRejection, the same Host/Origin and
session fence every other route in Harness uses. The reply is sent before the
process exits, which is why the page treats a hung fetch as success and then
polls /ping.
Examples
Check that the Host half is alive without clicking anything:
curl http://127.0.0.1:51885/__local-restart/ping
# {"ok":true,"port":51885}
A restart without a browser session is refused (expected, not a bug):
curl -i -X POST http://127.0.0.1:51885/__local-restart/restart
# HTTP/1.1 401 Unauthorized
Switch the row off from the profile's patch file, then relaunch:
# ~/.dsh/profiles/desktop/cordis.patch.yml
- id: dsh-restart-button
config:
enabled: false
Testing
The suite uses only node: builtins, so no install step is needed:
node --test # 12 structure/contract/helper-behaviour tests
node scripts/verify-package.mjs # packaging gate (also runs in prepack)
node --check index.js client.js restart-helper.mjs restart-utils.mjs
scripts/verify-package.mjs is the gate npm pack / pnpm pack runs: it fails
on a missing published file, a patch that names another package, an incomplete
locale catalog, or credential/home-path material in a shipped file.
The tests do not start Harness. What was verified against a running instance, and what was not, is recorded in docs/verification.md.
Releasing
- Bump
version, update CHANGELOG, run the checks in Testing, thennpm pack. - Create a GitHub Release and upload the tarball as
dsh-restart-button-<version>.tgz(the source zip andSHA256SUMS.txtare optional extras). - The Stable release asset workflow copies that
tarball to
dsh-restart-button.tgz, which is the URL the plugin catalogue installs from, soreleases/latest/download/dsh-restart-button.tgzalways serves the newest release.
Troubleshooting
The button does not appear. Confirm the bundle is installed
(dsh plugin --profile desktop list), that the row is not disabled on the
Plugins page, and that the sidebar is in its expanded state; the button is
placed in sidebar.footer.action.
The click works but Harness does not come back. Every step is appended to
%TEMP%\dsh-restart-<timestamp>.log ($TMPDIR on macOS/Linux). The log says
which step stopped: closing the application, waiting for the port, or starting
the replacement.
The replacement exits with EADDRINUSE. Another Harness instance still
holds the port. Quit the old instance, then click again.
The page stays on Restarting. The replacement did not answer within the
3-minute window; the label turns into Restart failed. Start Harness
manually and read the helper log.
On Linux under Wayland the window may take longer to reappear. The helper starts the executable detached and does not wait for a window; the page reload is the signal that the backend is up.
Roadmap
- Optional confirmation step (config flag), for users who click by accident.
- A keyboard shortcut for the same action.
- Cover the plain
dsh tuilaunch mode explicitly.
These are planned, not implemented. Nothing above is available in 1.0.x.
Contributing
Issues and pull requests are welcome. Read CONTRIBUTING.md first: it lists the checks a change must pass and the one rule this plugin never breaks (the endpoint stays behind the connection fence).
Security
The endpoint is restricted to the page that owns this application, and the helper only replays a local invocation. The trust model, the log-file contents and the reporting process are in SECURITY.md.
License
MIT © 2026 Lightfrom.
Acknowledgements
Built as a plugin for DeepSeek Harness. The sidebar layout, theme tokens and slot API come from the Harness client.
Plugins associés
dsh-web (dsh-task-board)
zhu1090093659/dsh-web
dsh-web (dsh-web-all)
zhu1090093659/dsh-web
dsh-TUI
ccch1mneyyy/dsh-tui
dsh-web-ui (dsh-task-board)
zhu1090093659/dsh-web-ui