dsh-neverdie
DiscoveredDeepSeek Harness (DSH) host plugin — auto-revives sessions whose turn was killed by a process exit ('Task stopped') after restart, and re-arms their active goals
Neverdie
Automatically revives DeepSeek Harness (DSH) sessions whose turn was killed by a process exit. When the host dies mid-turn, every session that was working ends up frozen behind a "Task stopped — The DSH process exited before this turn finished…" banner, dead until a human types something. Neverdie removes the human from that loop: after DSH restarts, the killed sessions come back to life on their own and keep working — and their active goals get re-armed so autonomous goal rounds continue.
Why
A DSH process that is killed, crashes, or times out during shutdown takes every running session down with it, and the cut-short turn shows up two different ways depending on how the process went:
- Hard crash (SIGKILL, OOM) — the log ends inside an open turn; restart recovery synthesizes a
turn/endcloser with reasoninterrupted. - Graceful exit / restart — the dying process gets to close the running turn itself, as reason
abortedwith causedisposed; the aborted tool call leaves an "Error: tool call aborted" message as the visible tail of the conversation.
Either way the session sits idle, dead until a human types something — even though the durable session log, the workspace, and the model context are all intact. All the work was interrupted, not lost. Long-running jobs (overnight builds, multi-hour agent tasks, goal-driven rounds) deserved better than "click Send again in the morning".
Neverdie is a host-side Cordis plugin that scans once after every boot, finds exactly the sessions that were mid-turn when the previous process died, and re-prompts them with a short configurable message so the agent resumes where it stopped.
Features
- Precise corpse detection — a session is revived only when the tail of its balanced log is a
turn/endclosedinterrupted(hard crash) orabortedwith causedisposed(graceful exit / restart). Deliberate stops (abortedcauseuser/parent/hook), sessions that ended normally, and sessions that already have newer input are never touched — matching on the abort cause rather than the visible "Error: tool call aborted" text is what keeps user-stopped sessions dead - Survives restart bookkeeping — the tail walker skips generation markers (e.g.
session/end-seed) that DSH appends after a restart, and synthesizes the interrupted closers in memory for cold logs, so detection works whether or not the session was reopened first - Live-but-idle counts as dead — the reconnecting web client resumes a session's log without resuming its work; neverdie treats that idle state as a corpse too
- Goal re-arm — goal activation is process-local, so the restart that killed the turn also disarmed the session's goal. Neverdie re-arms active goals through the supported
goals.resumepath, so automatic continuation rounds keep running. Paused, blocked, complete, or round-exhausted goals are respected as-is - Crash-loop guard — at most
maxRevivesconsecutive neverdie revives per session since the last genuine user message; a host that keeps dying cannot burn tokens forever, and one real user message resets the budget - Auditable — every revive is a normal user message tagged with the merge-extensible source kind
neverdie, visible in the transcript and countable from the session log, plus a[neverdie]line in the host journal
How it works
- The host process dies mid-turn. The plugin dies with it — nothing can act at the moment of death.
- Whatever supervises DSH (e.g. systemd
Restart=on-failure) starts a new process; the plugin arms and waitsdelaySecondsfor boot to settle. - One scan: list sessions cheaply, then fully read the balanced log of each fresh, non-archived, root candidate.
- A backward walker finds the log's last turn end; only an
interruptedone or anaborted-with-disposed-cause one, with no newer turn, message, or pending inbox input, qualifies. - For each corpse:
resolveAgent(resumes the cold session), re-arm its active goal if disarmed, queue the revive message, flush to durable storage. - The agent continues the interrupted task. If the host dies again, the next boot repeats the cycle within the revive budget.
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Master switch |
delaySeconds | number | 10 | Wait after host start before the startup scan (0–600) |
maxAgeMinutes | number | 60 | Only revive sessions whose interrupted turn is younger than this (1–1440) |
maxRevives | number | 5 | Max consecutive neverdie revives per session without genuine user input (0–10) |
reviveMessage | string | (see below) | The message injected to revive a session |
resumeGoals | boolean | true | Re-arm active-but-disarmed goals during revival |
Default revive message:
[neverdie] The DSH process exited before the previous turn could finish, so that turn was closed. Continue the interrupted task from where it stopped. Tool calls that were cut off have unknown outcomes — inspect their effects before retrying them.
Notes & limitations
- Restart must come from outside. Neverdie revives sessions after the host is back; it cannot restart the host itself. Pair it with a supervisor such as systemd (
Restart=on-failure). - A literal empty prompt is not possible. The harness rejects whitespace-only prompt content, so revival sends a real (short, configurable) message instead.
- Root conversations only. Subagent children are left to their parent sessions, which the parent's own revival reconciles.
- Freshness bounded. Corpses older than
maxAgeMinutesstay dead — raise the window if your host can be down for a long time.
License
MIT © pinion05
Comments
Loading…
Similar plugins
by flandre2233
Auto-resumes DSH turns interrupted by a host restart
★ 1
↓ 352/wk
MIT
JavaScript
Sep 24, 2026
dsh plugin --profile web add dsh-recovery-resumeby Eason-22
DeepSeek Harness plugin: restart without losing work, with an idle-aware graceful restart and automatic session resume after the host comes back. Built-in restart supports the Windows desktop app only
★ 2
MIT
JavaScript
Nov 9, 2026
dsh plugin --profile web add dsh-autorestartby Harzva
Adds confirmed DSH restart actions and durable automatic continuation for eligible top-level sessions through an existing compatible dsh-restart Host provider.
★ 0
MIT
JavaScript
Aug 29, 2026
dsh plugin --profile web add @harzva/dsh-restart-autoresumeby davidgereb
Restart your ongoing agent sessions once on server restart in DeepSeek Harness.
★ 0
MIT
JavaScript
Aug 15, 2026
dsh plugin --profile web add dsh-plugin-watchdogby 534056668
DeepSeek Harness plugin: a restart row in Settings -> General that ends the host gracefully and lets the systemd unit's Restart=always bring it back. No detached helper, so KillMode=control-group cann
★ 0
MIT
JavaScript
Oct 25, 2026
dsh plugin --profile web add dsh-systemd-restartby LucienLL
DeepSeek Harness plugin: restart/status of the DSH web service with a detached self-healing watchdog, second-confirmation, and login autostart
★ 0
MIT
JavaScript
Oct 28, 2026
dsh plugin --profile web add dsh-service-watchdog