Adds a restart button next to the shutdown button in the bottom-right of the DSH Web GUI; the server comes back up and the browser reopens.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:hadesybil-hub/dsh-restart-button
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 small DeepSeek Harness (DSH) plugin that adds a floating restart button to the bottom-right corner of the Web GUI. One click restarts the application; the next window is a cold start.
What it does
| Floating button | Pinned to the bottom-right corner, refresh glyph, tints on hover |
| Confirm gate | One click → themed "重启 DeepSeek Harness?" card → restarts only if confirmed |
| Desktop app | Restarts the whole application: the Electron shell closes (its own quit path disposes the Host and flushes sessions) and the same executable is launched again |
CLI dsh web |
Refuses with 501 desktop-only: there is no shell to restart, and this plugin will not spawn a competing server |
| Route | POST /api/dsh-restart/restart (loopback-only) |
| Result | In a browser tab the page watches the server leave and return, then reloads itself |
Install
dsh plugin --profile desktop add @darkthee/dsh-restart-button
Restart the application once: the Host reads bundle manifests at startup.
How it works
The Desktop shell spawns the Host as a child process (<exe> --expose-internals .../dsh-desktop-host/lib/index.js) and exposes no restart seam to plugins — ctx.appExit only stops the Host, which leaves the shell showing its recovery dialog. So the restart is owned by a process that can outlive both:
- Host half (
lib/index.js): registers the loopback-only route. OnPOSTit startslib/restart-helper.mjsas a detached, unref'd child, then answers202. It reads the two facts the helper needs from its own process:process.ppid(the shell) andprocess.execPath(the executable). - Helper (
lib/restart-helper.mjs): waits for the response to reach the page, asks the shell to close (taskkill <pid>without/F, i.e.WM_CLOSE;SIGTERMelsewhere), then waits for the pid to actually disappear and launches the same executable. Launching only after the pid is gone matters: the shell holds a single-instance lock, so an early second instance would just hand its arguments to the dying first one. - It never force-kills. If the shell is still alive after 25 s — a person answered the shell's own quit confirmation with cancel, or something is wedged — the helper logs it and gives up. Killing there would override a deliberate cancel and could truncate Host writes.
- Client half (
lib/client.js): plain DOM, no React, no build step. Loaded throughwindow.__ModuleLoader__; the module id equals the package name, which is how the Host maps a browser bundle to its entry.
Security
- The route is loopback-only: peer socket,
Hostheader, and same-origin fence. The Desktop shell forwardsdsh-app://app/*to the Host after strippingorigin/host/cookie, so a Desktop request arrives origin-less and passes the fence; a cross-site browser request cannot. - Restarting spawns exactly one process (the helper) and writes nothing but a log line.
Diagnostics
~/.dsh/dsh-restart-button.log (or $DSH_HOME/dsh-restart-button.log) records each step: the requested restart, the graceful close, the wait, the relaunch, or the reason it gave up.
License
MIT
Repository
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10669
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★ 10669
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★ 8366
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7489
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★ 5362
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1070
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.