Introduction¶
DSH’s Web capabilities can be split into plugin installation, but the Web host process itself does not restart automatically after exiting. dsh-keepalive solves this problem: after explicit enablement, it runs a detached watchdog to monitor the DSH Web process and restarts it with the same binary and arguments after the process exits.
It also provides an optional repair agent. After repeated start-up failures, the repair agent can inspect issues within a controlled scope, modify the allowed repair workspace, and rollback failed repairs based on a snapshot.
What is this¶
dsh-keepalive is maintained by xiaohj233 and is licensed under MIT.
It is positioned as an opt-in plugin for:
- Providing a detached watchdog for the DSH Web process;
- Restarting DSH after the process exits;
- Providing optional snapshot-checked repair;
- Providing explicit compatibility patch restoration.
It is not a high-availability cluster, a service manager, a sandbox, a malware boundary, a secret scrubber, nor a complete isolation or confidentiality boundary.
Core Features¶
The capabilities listed below are based on verified facts and require explicit enablement via configuration.
- Runs a detached watchdog for the DSH Web process after enablement.
- Restarts DSH with the same binary and arguments after the process exits.
- Adds a Plugins settings card to configure the watchdog.
- Supports manual restart via the “Manual Restart” button on the card or POST /api/keepalive/restart.
- Applies guarded compatibility patches, covering the keepalive settings namespace and hidden Windows child processes.
- Optionally runs a repair agent after repeated boot failures.
- Snapshots the allowed repair workspace before repair.
- Validates paths, configuration, and syntax after repair; rolls back on failure.
- Provides a zero-dependency repair status page on the web port during repair.
- Displays a global repair progress banner when status=repairing.
Installation and Enablement¶
Requirements:
DeepSeek Harness: 0.1.0-rc.6
Node.js: ^22.19.0 || >=24
pnpm: >=10
The watchdog has been tested on Windows.
Installation command:
dsh plugin --profile web add "github:xiaohj233/dsh-keepalive#v0.1.0"
The Web profile needs to be restarted after installation. Simply installing does not enable watchdog restart or repair.
Enablement requires explicit opt-in within the keepalive section:
keepalive:
enabled: false
autoRepair: false
Both enabled and autoRepair need to be explicitly enabled; autoRepair defaults to false. You can configure this via the Plugins settings card or settings file.
Typical Usage¶
Manual restart:
POST /api/keepalive/restart
You can also use the “Manual Restart” button on the Plugins settings card.
Read status:
/api/keepalive/status
You can read the current status and the last repair-agent output from this address. The last repair-agent output is limited to 4 KB.
To uninstall, first run the uninstall command, then remove the plugin from the profile:
pnpm --dir "$DSH_HOME/profiles/web" exec dsh-keepalive-uninstall
dsh plugin --profile web remove dsh-keepalive
Applicable Scenarios and Considerations¶
If you need automatic recovery after the DSH Web process exits and are willing to accept that the repair agent modifies the plugin workspace within a controlled scope, this plugin can be used as a tool.
If you need complete isolation, confidentiality boundaries, credential scrubbing, or wish for it to replace systemd, Windows Service Control Manager, containers, or external monitoring, it is not suitable.
Please note:
- The repair runtime uses workspace-write, allowing modification of the plugin workspace.
- The repair agent receives startup diagnostics as input; these diagnostics are untrusted and may contain misleading instructions.
- Snapshots, path, syntax, and rollback checks reduce accidental modifications but cannot make arbitrary agent output secure.
- Changes must be checked after every repair.
- Watchdog supervision and uninstall only identify the watchdog by the recorded PID; if the PID is reused by an unrelated process, supervision may stop silently, and uninstall may terminate the unrelated process.
- After repeated missed polls, the watchdog forcibly terminates the process listening on the configured port; if that port is occupied by an unrelated service, that unrelated service will also be terminated.
- Failed-launch diagnostics and the last repair-agent output are persisted and can be read from /api/keepalive/status; failed-launch logs may embed secrets in the environment.
- It runs with the privileges of the current dsh process; you should check the source code and the MIT license before installation.
Links¶
- Directory page: https://www.skillhub.cn/plugins/xiaohj233/dsh-keepalive
- GitHub: https://github.com/xiaohj233/dsh-keepalive