DeepSeek Harness (DSH) developers often need to handle service restarts or status monitoring during routine maintenance. Manual restarts can easily lose context and leave orphaned processes behind. The dsh-service-watchdog plugin provides a direct service control entry point and status monitoring in the main UI, and includes an independent watchdog for crash self-recovery and autostart.

This is an admin-security type plugin maintained by LucienLL. It integrates service restart, status monitoring, and process guarding into DSH’s sidebar UI, and uses a persistent standalone process to automatically revive the service after a crash and apply code hot updates.

Core Features

Sidebar status monitoring
The sidebar displays the service status (Running/Stopped/Starting) and uptime in real time (polling every 3 seconds).

Quick restart with secondary confirmation
When you click Restart, the plugin checks the current number of in-progress sessions, queued messages, and background tasks. If tasks exist, a confirmation dialog is shown; if not, the restart proceeds directly. After the restart, it reports success or failure.

Watchdog self-healing
When DSH starts, it spawns a standalone persistent process. If the main service crashes, the watchdog automatically starts the service. After the service is stopped, the button can start it again.

Watchdog code self-update
The host probes the watchdog code (lib/watchdog.js) for changes every 15 seconds. If the code changes, the watchdog restarts automatically to load the new code, without manually killing the process.

Autostart at boot
The plugin writes a startup entry under the HKCU Run registry key. After login, the watchdog and service start automatically.

No residual processes
During restart, taskkill /T /F is used to terminate the entire process tree, and the service is started only after confirming that the port has been released (wait up to 15 seconds).

Installation and Configuration

Installing the plugin requires the official CLI:

dsh plugin --profile web add dsh-service-watchdog

After installation, configure the following items in DSH’s settings:

Configuration key Default Description
watchdogPort 3199 Watchdog control port, listening on 127.0.0.1 only. Changing it at runtime automatically cleans up the old watchdog.
autostart true Controls the autostart feature.
crashRestart true Controls automatic restart after a service crash.

Security and Notes

Network restrictions
The watchdog binds only to 127.0.0.1, does not accept non-loopback Host connections, and returns 403 for cross-origin requests.

Process protection
Before killing a process, it verifies that the target PID’s image is node.exe to avoid accidentally killing other programs occupying the same port.

Environment variable filtering
When persisting the startup command, sensitive information such as token, key, secret, credential, and CODEX_ is filtered.

Log location
The watchdog log file is located at %LOCALAPPDATA%\DeepSeekHarnessApp\watchdog.log.

This plugin solves the status visibility and exception recovery issues in DSH service maintenance. For more information, see the plugin directory or GitHub repository.