Introduction¶
When running overnight builds, multi-hour agent tasks, or goal-driven rounds with DSH, the most common crash isn’t a model error, but the host process disappearing: killed by SIGKILL, OOM, timeout, or a restart. Once the process dies, all sessions it was carrying stop in their tracks. The top of the session shows a line “Task stopped — The DSH process exited before this finished…”, and it hangs there, waiting for someone to send a new message to continue. The logs, workspace, and model context are actually intact; the work is just interrupted, not lost.
The existing workaround is to manually click “Send” in the morning. pinion05/dsh-neverdie delegates this step to a plugin: after DSH restarts, it scans the sessions to find which ones were running a turn when the process died, and automatically sends a new prompt to let the agent continue.
What is it¶
pinion05/dsh-neverdie is a DSH host plugin belonging to the “Workflow” category, maintained by pinion05, and licensed under MIT. Its scope for solving problems is narrow: when the DSH process exits midway, leaving a batch of sessions stuck in the “Task stopped” state, the plugin wakes them up after the host restarts and re-arms goals that became invalid due to the restart, allowing autonomous rounds to continue.
The package name is @npmc_5/dsh-neverdie, the repository is pinion05/dsh-neverdie, version 0.3.0. The repository is publicly available with 0 stars. It is not a generic scheduler nor a tool to restart DSH; it only performs a scan after the host has already restarted.
Detection Logic¶
Process exits happen in two ways, resulting in different endings in session logs, which the plugin uses to distinguish whether a session should be “awakened”.
During a hard crash (SIGKILL, OOM), the log stops in an unclosed turn. A restart recovery synthesizes a turn/end closure for this cold log with a reason of interrupted. During a graceful exit or restart, the dying process closes the running turn itself, with reason aborted and cause disposed, leaving a line “Error: tool call aborted” at the end of the dialogue for the aborted tool calls.
The plugin walks back from the end of the log to find the last turn/end. Only the two types above count as “dead sessions”:
- No updated turns, messages, or pending inbox inputs;
- The abort’s cause is not
user,parent, orhook—meaning sessions explicitly stopped by the user will not be awakened; - If the tail contains generation markers appended after a restart (e.g.,
session/end-seed), they are skipped; for cold logs,sessionQuery.readSessionsynthesizes theinterruptedclosure in memory, so the judgment logic is the same regardless of whether the session was reopened beforehand.
There is another easily overlooked case: reconnected web clients restore the session log but do not restore its work. This “alive but spinning” state is also treated as a dead session.
After passing the judgment, the plugin performs resolveAgent (waking the cold session) on candidates, re-arms the goals, and finally queues the revive message and writes it to persistent storage. Every scan logs a [neverdie] line in the host journal, and each revive message carries the neverdie source kind, visible in the transcript and countable from the session logs.
Goal Re-mounting¶
Goal activation state is process-level, so the restart that killed the turn also invalidated the session’s goal. The plugin uses the supported goals.resume path to remount it, provided the goal is in active status and activation is disarmed. Goals in paused, blocked, complete status, or those whose rounds are exhausted, are left as is; goals with exhausted rounds will explain why in the log.
Configuration¶
There are six configuration items, with default values as follows:
| Configuration Item | Type | Default Value | Description |
|---|---|---|---|
enabled |
boolean |
true |
Global switch |
delaySeconds |
number |
10 |
Wait time after host startup before scanning, value 0–600 |
maxAgeMinutes |
number |
60 |
Only revive sessions interrupted within this window, value 1–1440 |
maxRevives |
number |
5 |
Upper limit on consecutive neverdie revives of the same session after the last real user message, value 0–10 |
reviveMessage |
string |
See below | Message injected during wake-up |
resumeGoals |
boolean |
true |
Whether to re-mount active but disarmed goals during wake-up |
Default reviveMessage:
[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.
This message itself is necessary: the harness does not accept a purely blank prompt, so a wake-up must send a real short message. The message reminds the agent that the results of cut-off tool calls are unknown and to inspect the situation before retrying.
maxRevives is the gate to prevent crash loops. If the host keeps dying, the plugin will revive it every time it starts, up to maxRevives times in a row; as soon as a real user message arrives, the budget resets, preventing the crash from continuously burning tokens.
Installation and Enablement¶
Neither the README nor package.json provides an installation command. The repository declares a Cordis patch via dsh.bundle.patch pointing to ./cordis.patch.yml. The package also exports index.js, locale/*.json, and icon.svg, and declares peer dependencies on @deepseek-ai/cordis, @deepseek-ai/schemastery, and @deepseek-ai/dsh-llm.
Therefore, an installation command is not provided here. The dsh plugin add form constructed by name is not from the source material; please refer to your local DSH plugin management method, import from the npm package @npmc_5/dsh-neverdie or the repository pinion05/dsh-neverdie, and confirm that the peer dependencies match your existing version before installing.
Typical Usage¶
When preparing for production, first hand the host process over to supervision:
- Wrap DSH with a supervisor like systemd and configure
Restart=on-failure. The plugin itself cannot restart the host; it only acts after the host returns. “Who restarts” must be provided externally. - Increase
delaySecondsto leave enough time for startup and cold log recovery, avoiding scanning before the recovery logic. - If the host is expected to be offline for a long time, increase
maxAgeMinutesaccording to the offline duration; sessions outside the default 60 minutes will not be revived. - Check the logs to confirm: the appearance of
[neverdie] revived session ...and[neverdie] re-armed goal ...in the journal indicates the corresponding session was awakened and the corresponding goal was re-armed. - When issues occur, verify item by item against the
neverdiemarkers in the transcript to confirm whether a specific wake-up was expected behavior.
Use Cases and Considerations¶
It is suitable for those who: run long tasks or goal-driven rounds with DSH, and whose host is started by an external supervisor like systemd. It eliminates the step of “clicking Send in the morning,” allowing interrupted tasks to pick up automatically after a restart.
Several hard constraints:
- Only handles the root conversation. Subagent child sessions are handled by the parent session; the parent session’s own wake-up will align them.
- Sessions older than
maxAgeMinutesremain in a dead state. Do not expand the window too much, otherwise tasks that should have been manually picked up long ago will be automatically continued. - The plugin runs with the permissions of the current DSH process. Read
index.jsandcordis.patch.ymlbefore installing to confirm that the patch behavior and license (MIT) meet your requirements. - Ecosystem context: DSH’s philosophy is “everything is a plugin”. The community directory site is an independent site with no official affiliation to DeepSeek / Hypi, verify the source yourself before installing.
Conclusion¶
This plugin does not expand DSH’s capabilities; it simply fixes a link that usually requires manual monitoring: when the process dies, after the restart, the interrupted session stands up and continues running, and the goals continue their rounds. If you are already using a supervisor to run DSH and your long tasks are interrupted by restarts at night, it is worth a try.
Directory page: https://www.skillhub.cn/plugins/pinion05/dsh-neverdie
Repository: https://github.com/pinion05/dsh-neverdie