Introduction¶
The DeepSeek Harness (DSH) Web process serves both the WebUI and the harness backend. Restarting dsh web refreshes both parts at the same time. Restarting directly may carry a risk of accidental triggering and can interrupt ongoing tasks. This plugin adds a restart button to the Web UI sidebar, requires users to perform a second confirmation before restarting, and automatically relaunches the process after confirmation.
Plugin Introduction¶
- Positioning: A one-click restart button for the DSH Web UI sidebar, with forced double confirmation and automatic relaunching.
- Maintainer: seanwhy
- License: MIT
Core Features¶
- Forced double confirmation: Clicking the button shows two confirmation dialogs. Only the second confirmation sends the restart request, and both confirmations can be canceled.
- Adaptive layout and size: The button is fixed near the sidebar collapse/expand button, and the SVG icon size adjusts automatically with the layout.
- Automatic relaunching and immediate refresh: After the process restarts, the client polls the
/dsh-healthendpoint and refreshes immediately once the new process is ready. - Cross-platform, with no hardcoded paths: Reconstructs the startup command based on the current process’s
process.execPathandprocess.argv, adapting to various startup methods (CLI, PWA, supervisor scripts). - Graceful termination (SIGTERM -> SIGKILL): Sends SIGTERM first; if the process does not exit, sends SIGKILL.
- Configurable: Supports configurable delay, custom command, and kill-only mode.
- Reentry protection: Rejects a second request while a restart is in progress.
- Loopback-only access: The restart endpoint only accepts requests from 127.0.0.1 / ::1.
- Theme-aware UI: Uses DSH theme tokens and adapts to light/dark mode.
- Waiting dots: Hidden by default; polls the marketplace operation snapshot and shows only when another plugin is in a pending install/update/removal state (requires restart).
Installation and Enablement¶
Install the plugin using the following command:
dsh plugin --profile web add github:seanwhy/dsh-restart-confirm
After installation, restart dsh web once to load the plugin.
Typical Usage¶
- Click the sidebar button, complete the forced double confirmation, and restart.
- Configure
killOnlymode to work with an external monitor: whenkillOnlyis enabled, the plugin only terminates the process and does not relaunch it, making it suitable for external process managers (such as supervisor) to take over the restart logic. - Configure a custom command: specify a startup command that replaces the default argv via
customRestartCommand.
Working Principle and Security¶
- Security mechanisms:
POST /restart-dshonly accepts loopback callers. The web server binds to the loopback address by default. The plugin does not send data anywhere, and/dsh-healthis used only for local health checks. - Restart mechanism: The plugin starts a detached helper process (independent of the DSH main process). This helper is responsible for delaying, terminating the process, and relaunching after a delay. The main process client polls the
/dsh-healthendpoint and refreshes immediately when abootIdchange is detected. - Reentry protection: Rejects a second request while a restart is in progress.
- Graceful termination: Sends SIGTERM first; if the process does not exit, sends SIGKILL.
Notes¶
- Version compatibility: Version 0.1.2 is compatible with DSH 0.1.0-rc.6 through 0.1.0-rc.8.
- Permissions and security: The plugin runs with the permissions of the current dsh process. Review the source code and license before installation.
Conclusion¶
Related links:
- DSH Plugin Catalog
- GitHub Repository