Adds a sidebar Restart button to DeepSeek Harness Desktop on Windows that stops the whole application process tree and reopens the app.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-restart-desktop
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:StarMoon-win/dsh-restart-plugin
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A restart button for the DeepSeek Harness Desktop sidebar. One click fully quits the Electron application and opens it again — no tray menu, no terminal, no hunting for the window.
中文说明:README.zh.md
Features
- One click, real restart. The whole desktop app exits and starts again — the same thing as closing it from the tray and reopening it, but in one action.
- Lives where you expect it. A row in the sidebar footer, directly above Settings; in the collapsed 56px rail it becomes a round icon button.
- Stays out of the way. The button only renders when the Host reports that this is a Windows desktop app; in
dsh webor on unsupported platforms it hides itself. - No shell windows. The relauncher is a detached Node process and a hidden PowerShell child; nothing flashes on screen.
- Evidence when it fails. Every attempt appends to
%TEMP%\dsh-restart-desktop\restart.log, and the launch is verified with a retry. - Localized. English and Simplified Chinese UI text, display metadata for the plugin manager, and its own original icon.
Requirements
| DeepSeek Harness | Desktop build (Electron), dsh >= 0.2.0-rc.1 |
| OS | Windows 10/11 |
| Node | 20+ (only for development) |
The plugin is a DSH bundle: a Host half plus a browser half. It is not an npm dependency of your project; it installs into a DSH profile.
Install
From the repository URL
Add the bundle to your profile (~/.dsh/profiles/<profile>/package.json) and restart the app — keep your existing entries and add one line in each list:
{
"dependencies": {
// ...your existing entries
"dsh-restart-desktop": "github:StarMoon-win/dsh-restart-plugin"
},
"dsh": {
"profile": {
"bundles": [
// ...your existing entries
"dsh-restart-desktop"
]
}
}
}
Or use your build's plugin manager (Settings → Plugins) to install from the GitHub source. New bundles activate live; refresh the page if the sidebar does not show the button yet.
From a local checkout
git clone https://github.com/StarMoon-win/dsh-restart-plugin.git
Then point the profile at the checkout:
"dependencies": {
"dsh-restart-desktop": "link:/absolute/path/to/dsh-restart-plugin"
}
and add "dsh-restart-desktop" to dsh.profile.bundles, or install the directory through the plugin manager.
Uninstall
Remove dsh-restart-desktop from dsh.profile.bundles (and from dependencies), then restart the app.
Usage
- Find Restart in the sidebar footer, above Settings.
- Expanded sidebar: icon +
Restart/重启. - Collapsed rail: a round icon button with a native tooltip.
- Expanded sidebar: icon +
- Click it. The page shows
Restarting…, the app exits after about a second, and a fresh instance opens. - Running tasks are interrupted. There is no confirmation dialog — the click is the confirmation.
If the button shows Restart failed, wait a few seconds and try again, then read the log:
%TEMP%\dsh-restart-desktop\restart.log
How it works
Sidebar button (client.js)
│ GET /dsh-restart-desktop/status → render only when supported
│ POST /dsh-restart-desktop/restart → 202, then the page dies with the app
▼
Host routes (index.js)
│ write %TEMP%\dsh-restart-desktop\request.json
│ spawn helper.mjs (detached, ELECTRON_RUN_AS_NODE=1)
▼
Relauncher (helper.mjs)
1. wait 1.2 s so the HTTP response can leave the Host
2. compute the application process tree by image name
(Windows PowerShell; excludes the helper and the PowerShell child)
3. terminate the tree: main process, renderers, GPU, Host,
and the tool processes those started
4. start the same executable with a clean environment
5. verify after 4 s; retry up to three times; log everything
Why force-terminate?
The desktop shell turns a window close into hide to tray, and quitting asks the Host whether tasks are active before showing a confirmation dialog. app.asar exposes no app.quit() / app.relaunch() channel to plugins — the only Host-facing control messages are quit-inspection and update-tasks, both initiated by the Electron main process.
So the only way a plugin can produce a complete restart is to end the application tree from outside it and start the executable again. That is exactly what the detached helper does.
Security
The two routes are reachable only from the same machine and the same page:
- loopback peer only (
127.0.0.1/::1); - requests carrying
Forwarded,X-Forwarded-For, orX-Real-IPare rejected; Hostmust be a loopback authority (127.0.0.1,localhost,[::1]), which also refuses DNS rebinding;- when
Originis present it must matchHost; - the headerless “loopback, no Host, no Origin” shape of the desktop document proxy is accepted;
- restart requires
POST;GET /dsh-restart-desktop/restartanswers405.
Development
git clone https://github.com/StarMoon-win/dsh-restart-plugin.git
cd dsh-restart-plugin
node --check index.js
node --check client.js
node --check helper.mjs
node scripts/validate.mjs
scripts/validate.mjs checks the manifest exports, the locale files, the icon, and the patch file without activating the plugin.
To exercise the relauncher without touching the app, point a request file at a harmless program (for example notepad.exe, image notepad, a 200 ms delay) and run node helper.mjs <request.json>; the log shows the stop, launch, and verification steps.
Reloading a linked checkout
A profile installed with link: points at your working tree. Host code is not hot-reloaded across that junction, so after editing index.js or helper.mjs:
- disable and re-enable
dsh-restart-desktopin Settings → Plugins (or via the plugin manager), or - restart the app with the new button.
The browser half (client.js) is picked up on the next page load.
Troubleshooting
| Symptom | Check |
|---|---|
| No button in the sidebar | Is the profile the desktop one and the bundle in dsh.profile.bundles? Open /dsh-restart-desktop/status on the app origin; supported must be true. |
| Button always says “Restart failed” | Read %TEMP%\dsh-restart-desktop\restart.log. A missing launched pid=… line means the helper could not start the executable. |
Install fails with timed out waiting for the writer lock |
A stale package.json.lock in the profile; restart the app so the recorded holder PID is gone, then install again. |
| App exits but does not reopen | The log ends with FAILED: the application did not come back. Start the app manually and report the log. |
License
MIT © Star_Moon_win
GitHub topics
This repository is tagged:
deepseek-harness · dsh · dsh-plugin · deepseek · cordis · cordis-plugin · electron · desktop · restart · windows
They are also mirrored in package.json → keywords for npm and search.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10735
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10735
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8661
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7538
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5419
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1103
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.