dsh-autorestart
DeepSeek Harness plugin: restart without losing work. It waits until every conversation is idle, restarts the host, and picks the interrupted work back up instead of dying with it; where a supervisor already manages the host it asks that supervisor, and it never starts a second host next to a runnin
Install
dsh plugin --profile web add dsh-autorestart
Sandbox test results
| Stage | Result |
|---|---|
| 1 install | ✓ |
| 2 list | ✓ |
| 3 mount | ✓ |
| 4 boot | — |
Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).
README
dsh-autorestart
Restart DeepSeek Harness without losing the work that is currently running.




Chinese version: [README.zh.md](docs/README.zh.md)
Current version: 0.9.2
What it does
Three small things, all around restarting.
1. The restart is queued. An agent asks for a restart; the plugin does not cut off the conversations that are still running. It waits until every one of them is idle, restarts the host, and picks the interrupted work back up — the sessions resume and a goal is re-armed. When several conversations ask at once the requests are merged into one restart, and every requester is woken afterwards. A goal-carrying session cannot block the restart forever: its goal is disarmed before the restart (the running round still finishes) and re-armed after it.
2. It backs up before each restart. The configuration and the local link: plugin directories are saved under ~/.dsh/storages/dsh-autorestart/backups/. At most maxBackups copies are kept (default 2, range 2–10); old and incomplete ones are pruned. A snapshot that cannot be removed (for example because a file inside it is locked) is reported in backupHygiene.error rather than silently kept, so the count can briefly exceed the limit.
3. It clears the login cookies. Every launch leaves a dsh-auth-* entry behind; they pile up until the request header overflows (~16 KB), the server answers 431, and the client can only say Web authentication failed. The plugin clears those stale credentials before each restart and records the outcome in last-cookie-clear.json.
There is also a countdown shutdown: a moon button at the bottom of the sidebar waits for every conversation to finish, counts down on screen, and powers the machine off.
What it does not do
- It does not watch the host and does not decide whether a restart came back.
- It does not restore anything on its own. The backup is never applied automatically; it is there for you to inspect or roll back by hand. The one exception is the start-at-login supervisor, if you installed it: that separate process rolls the last snapshot back when the host refuses to start.
- There is nothing left to run by hand. If the host will not start, use its own crash dialog or reinstall the plugin.
Tools for the agent
Tool · What it does
continuum_restart · Queue a graceful restart (waits for every conversation to be idle)
continuum_status · Phase, generation, queued requests, which sessions are blocking
continuum_cancel_restart · Withdraw a queued request (scope: "mine" or "all")
continuum_park_goal · Disarm a goal so a queued restart can proceed
continuum_recover_now · Retry post-restart recovery immediately
continuum_handoff · Hand an over-limit session off to a fresh one
continuum_supervisor · Inspect or install the self-starting supervisor
Configuration
The settings page writes these; the defaults are the ones in the code.
Key · Default · Meaning
restartMode · app · app = ask the desktop client to relaunch itself; command = run your own restart command
restartCommand · '' · The command used when restartMode is command; supports the {pid}, {ppid} and {app} placeholders
settleMs · 2000 · How long the host must stay quiet before the restart may start
restartGraceMs · 0 · Extra wait after the last conversation went idle, before the host is really restarted — a dropdown: 0 / 5 / 10 / 20 / 30 / 60 seconds. 0 = no extra wait
queuedGraceMs · 60000 · How long a queued inbox message may sit before it stops blocking the restart. A running conversation always blocks
forceRestartWhenBusy · false · Interrupt a running conversation instead of waiting. The default never interrupts a session
deferPollMs · 3000 · Poll interval while waiting for the conversations to go idle
relaunchDelaySeconds · 2 · How long the detached helper waits before it kills the app
backupOnRestart · true · Take a snapshot before every restart
backupIncludePlugins · true · Include the locally linked plugins in that snapshot (~117 MB here, ~3 s). false keeps only the configuration files
maxBackups · 2 · How many snapshots to keep (2–10)
restartCommandTimeoutMs · 30000 · How long the restart command may run before the plugin stops waiting for it
showSleepButton · true · Show the countdown-shutdown button
sleepCountdownSeconds · 20 · Countdown length before powering off — a dropdown: 0 / 10 / 20 / 30 / 60 seconds
sleepCommand · '' · Override the power-off command
resumeOnBoot · true · Resume interrupted sessions after a restart
recoveryDelayMs · 6000 · Wait before the first resume attempt
maxResumeAttempts · 2 · Resume attempts per session, counted across boots
maxSessions · 4 · How many sessions are resumed per boot
continuationText · '' · Override the continuation prompt text
stateFile · '' · Path of the checkpoint file. Empty = <DSH_HOME>/storages/dsh-autorestart/state.json
autoReloadPage · true · Reload the web page after a restart
blockManualRestart · true · Refuse an agent that tries to kill or relaunch DSH by hand, and point it at continuum_restart instead
healthPath · /__dsh_autorestart/health · Health check route: the boot id, the pid, the phase and the self-check flags
enabled · `tr
…(truncated)
Rendered from the README published on npm. Formatted only, not edited.
Versions
Published on npm::25,最后更新 2026-11-05