DeepSeek Harness Plugin

RayZan-J/dsh-app-restart

Stars ★ 0 Downloads (30d) 311 Category Development & Runtime Added 2026-12-01 npm dsh-app-restart

Adds a restart button to the Session header, so a plugin change no longer needs the tray menu in the bottom-right corner of the screen. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-app-restart

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:RayZan-J/dsh-app-restart

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

Restart the DeepSeek Harness desktop app from a button in the Session header.

中文说明

The shell's only restart entry is the tray menu in the bottom-right corner of the screen. While you are iterating on a Host-side plugin you pay that trip over and over. This bundle puts the same action in the window: one 28px icon next to the header's other utilities.

Press What happens
First click the button turns red and reads 再点一次重启 / Press again to restart for four seconds
Second click the page shows 正在重启…, then the app closes and reopens
Ctrl+Alt+Shift+R arms the button exactly like a click, so a stray chord restarts nothing

A restart ends the page, so the press is deliberately two steps; there is no way to restart by accident.

Install

In DSH, open Plugins → Add plugin and enter one of:

  • dsh-app-restart — from npm
  • RayZan-J/dsh-app-restart — straight from this repository
  • an absolute path to a clone of this repository

Enable the bundle, then reload the page once so the button loads.

How it works

A plugin runs inside the shell's Node host, which has no app.relaunch(): the only message the parent channel accepts from it is a shutdown request. So the bundle reproduces the tray item from the outside.

  1. The page POSTs to /app-restart/restart with an x-app-restart header. The desktop window sends no Origin at all: the shell serves it from dsh-app://app and deletes that header before forwarding the call to this listener. The Host first runs DSH's own admission gate (connection.requestRejection): Host and Origin fences plus the signed browser credential it issued. The shell's proxy forwards that cookie, so the button is admitted; a request without it is refused before anything is scheduled.
  2. The Host writes a PowerShell helper to $DSH_HOME/app-restart/ — restart.ps1 plus a restart.json naming the request — and starts it through cmd /c start, which gives it a console and a parent chain of its own. The helper has to outlive the process that spawns it.
  3. The helper waits, asks the app to close, stops whatever is left of the same executable, and starts it again.
  4. Every step is appended to $DSH_HOME/app-restart/restart.log.

Limits

  • Desktop app only. A page served by dsh web has no shell to relaunch; the button reports not-the-desktop-app and does nothing.

  • A restart ends the page and any turn that is running. Session logs, queued messages and drafts are on disk and come back.

  • The close request usually falls through to a hard stop: a shell that only hides its window never leaves the process table. Session events are committed one at a time, so a restart does not roll back what was already written.

  • A page opened from a reverse-proxy hostname is refused (cross-origin-restart); only the Host's own origin, or the app window's origin-less call, may restart it.

  • The route is closed to callers DSH does not admit: without the browser credential this Host issued it answers 401/403 (not-admitted) and never starts the helper. A page you open at the Host's own origin still holds that credential, which is why the button works there too.

  • If the app does not come back, start it by hand — the log names the step that failed. The helper can also be run manually, using the request restart.json describes:

    powershell -NoProfile -ExecutionPolicy Bypass -File "$env:DSH_HOME\app-restart\restart.ps1"
    

Licence

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.