Preface¶
The core design philosophy of DeepSeek Harness is “everything is a plugin.” When running or deploying dsh web locally (default listening on http://127.0.0.1:3080), sporadic crashes may occur in Windows environments (for example, a Node 24 libuv exit assertion failure, native TS type stripping, etc.). If the host process exits abnormally, it usually requires a manual restart, which affects development efficiency. The section below introduces the dsh-web-watchdog plugin, which achieves automatic recovery after a crash by running a detached PowerShell supervisor process.
What It Is¶
dsh-web-watchdog is a DSH Web GUI watchdog plugin maintained by catsenior507. It does not directly modify host logic; instead, it runs an independent supervisor process responsible for monitoring the host state, recording crash information, and launching a new host process when necessary.
Core Features¶
The plugin mainly provides the following capabilities:
- Crash logging: When the host exits abnormally (exit code != 0), it records the exit code, the tail of the host’s
stderrandstdout, writes the relevant events to the Windows Event Log, and finally aggregates them intocrash.log. - Automatic restart with exponential backoff: After detecting an abnormal host exit, it automatically restarts using an exponential backoff strategy. By default, it starts from 10 seconds, caps at 600 seconds, and allows at most 10 consecutive restarts.
- Scheduled restart: By clicking the button in the Web panel or sending an API request, you can manually mark a restart. The supervisor process completes the operation of stopping the old process and launching a new one within 2 seconds.
- Supervisor handoff: After the restart, the new host process starts its own supervisor process. The old supervisor process automatically exits after detecting that the PID file has been taken over, avoiding double supervision.
Installation and Enablement¶
Installing the plugin requires linking the local directory using an absolute path.
dsh plugin --profile web add link:<本目录绝对路径>
After executing the above command, restart dsh web to enable it. The corresponding status button will appear in the lower-right corner.
Typical Usage¶
After the plugin starts, it provides API endpoints on the default port 4795.
- View status
curl http://127.0.0.1:4795/api/watchdog/status
Returns the host PID, supervisor process status, current configuration, and the tail of crash records.
- View log
curl http://127.0.0.1:4795/api/watchdog/log?lines=60
Fetches the last 60 lines of crash log.
- Scheduled restart
curl -X POST http://127.0.0.1:4795/api/watchdog/restart
The browser connection may briefly disconnect; the supervisor process then starts a new host.
- Configuration override
The plugin’s default data directory is%USERPROFILE%\.dsh\web-watchdog. You can specify the data directory by setting the environment variableDSH_WATCHDOG_DATA, or change the default port by usingDSH_WATCHDOG_PORT.
Applicable Scenarios and Notes¶
- Platform limitation: This plugin is designed for Windows environments and is used to address sporadic crash issues.
- Restart policy: The plugin only monitors abnormal exits (exit code != 0) and restarts automatically. If the host exits normally (exit 0), the supervisor process does not start a new process.
- Permission requirements: The supervisor process runs with the permissions of the current
dshprocess. You should review the source code and license before installation.
Brief Conclusion¶
By decoupling supervision logic from the host process, dsh-web-watchdog provides a lightweight Web GUI stability assurance solution. Knowing its installation command and API usage can significantly improve the continuity of development and debugging on Windows.