seanwhy / dsh-restart-confirm

Listed

DSH (DeepSeek Harness) plugin: sidebar one-click restart of the dsh web process (WebUI + backend) with mandatory double confirmation, auto-relaunch, cross-platform. / DSH 插件:侧边栏一键重启(WebUI 与后台),强制二次确认,自动重新拉起,跨平台。

mainTool View source

Installation

npx -y @deepseek-ai/dsh plugin --profile web add github:seanwhy/dsh-restart-confirm

This installation command is an unverified starting point generated from the GitHub repository address.

README

Maintainer-authored documentation snapshot.

View on GitHub ↗
Commit b4a8020Synced Aug 18, 2026

dsh-restart-confirm

Sidebar one-click restart button for the DeepSeek Harness Web UI — with a mandatory two-step confirmation before anything happens.

ButtonA compact restart icon (↻) pinned to the sidebar fold toggle — left of "收起侧边栏" when expanded, above "打开侧边栏" in the 56px rail
SafetyYou must confirm twice before the restart is triggered
ScopeRestarts the dsh web process — the WebUI and the harness backend are the same process, so both come back together
RelaunchAutomatically re-runs the exact command that started DSH (process.execPath + process.argv) — no hardcoded paths, all flags (--host, --port, --trusted-host, profile) preserved
PlatformmacOS · Linux · Windows (detached helper survives the kill)
Status dotPolls GET /dsh-health every 5s — green online / red offline or restarting

Features

  • Two-step confirmation — clicking the button opens a first dialog ("restart?"), then a final warning dialog ("really restart? connection will drop for ~15–20 s"). Only the second confirm sends the request. Both dialogs can be cancelled.
  • Adaptive placement — the button is pinned next to the sidebar fold toggle via DOM placement: left of the collapse toggle when the sidebar is expanded, above the expand toggle in the 56px rail. A MutationObserver keeps it pinned through re-renders and collapse/expand transitions.
  • Auto-relaunch — after killing the process, the plugin re-launches DSH with the same argv from the same working directory, so sessions/tasks (persisted on disk) recover and the page reconnects by itself.
  • Cross-platform, zero hardcoded paths — the relaunch command is reconstructed from the running process itself. Works with any launcher (CLI, PWA, supervisor script).
  • Graceful kill — SIGTERM first, SIGKILL only if the process lingers.
  • Configurable — delay before kill, delay before relaunch, optional custom restart command, optional kill-only mode (external supervisor).
  • Re-entry guard — a second request while a restart is in flight is rejected.
  • Loopback-only — the restart endpoint refuses non-loopback callers.
  • Theme-aware UI — uses DSH's own --dsw-alias-* tokens, so the button and dialogs follow light/dark theme.

Install

dsh plugin --profile web add github:seanwhy/dsh-restart-confirm

Then restart dsh web once so the bundle layer loads.

Option B — DSH Plugin Marketplace

The repo carries the dsh-plugin topic, so it is indexed by the DSH Plugin Marketplace. Open Settings → Plugins → Plugin Marketplace, search dsh-restart-confirm, and install with one click.

Option C — Manual

  1. Add the dependency to ~/.dsh/profiles/web/package.json:
    {
      "dependencies": {
        "dsh-restart-confirm": "github:seanwhy/dsh-restart-confirm"
      }
    }
    
  2. Add the loader row to ~/.dsh/profiles/web/cordis.patch.yml (or install via the dsh plugin command which does it for you):
    - insert:
        - id: dsh-restart-confirm
          name: dsh-restart-confirm
    
  3. pnpm install in the profile, then restart dsh web.

Configuration

Plugin config (Settings → Plugins → dsh-restart-confirm → config, or the profile manifest):

OptionTypeDefaultMeaning
delaySecondsnumber3Seconds after the response before the process is killed (gives the browser time to show the "restarting" state)
relaunchDelaySecondsnumber2Seconds after the kill before DSH is relaunched
customRestartCommandstring''Custom shell command used to relaunch instead of the auto-reconstructed argv
killOnlybooleanfalseOnly kill the process; never relaunch (use when an external supervisor restarts DSH)

How it works

LayerFileWhat it does
Hostlib/index.jsRegisters GET /dsh-health + POST /restart-dsh on the webServer; launches a detached helper that sleeps → SIGTERM → (SIGKILL) → relaunches with the original argv
Clientlib/client.jsVanilla (no React) client that pins a compact icon button next to the sidebar fold toggle by DOM placement; two-step confirm dialog; polls GET /dsh-health for the status dot
Bundlecordis.patch.ymlThe loader row that mounts both halves

The handler replies before the kill happens; the helper script carries all the delays, so no host timer (which would be dropped outside a Cordis fiber) is needed.

Why an independent helper process?

If the plugin killed DSH from inside its own process, nothing would be left to relaunch it. The helper is detached (nohup sh … & on Unix, Start-Process -WindowStyle Hidden on Windows), so it survives the harness exit and brings DSH back up.

Security notes

  • POST /restart-dsh only accepts loopback callers (127.0.0.1 / ::1) and only POST.
  • The webServer binds to the loopback address by default in the shipped web profile.
  • The plugin never sends data anywhere; /dsh-health is a local-only liveness probe.

Development

The client bundle is hand-written in the exact wire format (window.__ModuleLoader__.load({ id, factory })) with no build step. It is dependency-free (no React), locating the sidebar fold toggle by its stable aria-labels and CSS-module class suffixes so no hashed class is hard-coded:

node --check lib/index.js
node --check lib/client.js

License

MIT

Repository information

Language
JavaScript
License
MIT
Last updated
Aug 18, 2026, 8:39 AM

Install deliberately

Review source code, permissions, lifecycle hooks, dependencies and network access. Test untrusted plugins in an isolated environment.