Introduction

In the DeepSeek Harness (DSH) environment, changes to the client bundle only take effect after the host process is restarted. If you need to update code or adjust configuration at runtime, you typically have to switch to the terminal, find the corresponding process handle, and run a restart command. This process is not only cumbersome but also prone to failure due to environment differences.

The dsh-simple-restart plugin solves this problem. It adds a control item to the DSH settings interface, allowing you to directly restart the running dsh web process through the browser UI while keeping the original startup arguments and runtime environment unchanged.

Core Features

This plugin independently manages its own routes and restart logic without depending on other plugins:

  • UI Integration: Adds a “Restart dsh web” button to the Settings → General settings row.
  • Process Restart: Starts a new process using the exact same invocation (executable file, arguments, working directory) as the original process.
  • Port Conflict Handling: Launches a detached helper process to handle port occupation, ensuring the new process can bind the port successfully.
  • Logging: Writes diagnostic logs to a temporary directory for troubleshooting.

Installation and Activation

Installing the plugin requires the DSH CLI tool and specifying the web profile.

  1. Install from a GitHub repository:
dsh plugin --profile web add "github:yizhixiaokong/dsh-simple-restart"
  1. If you need to pin the version, you can add a tag:
dsh plugin --profile web add "github:yizhixiaokong/dsh-simple-restart#v0.1.1"
  1. After installation, you must restart dsh web once. This is because the client bundle is baselined at startup, and the button appears in the settings interface only after a restart.

Usage

After enabling the plugin and restarting dsh web, follow these steps:

  1. Go to the Settings → General page.
  2. Click the “Restart dsh web” button.
  3. The button enters the “confirm” state and shows “Confirm restart?”.
  4. Click the button again within 5 seconds to confirm the restart.
  5. The system automatically handles the process replacement, and the browser page automatically reconnects after the new process is ready.

At this time, the status message below the settings row displays the PID of the exiting host process, the PID of the helper process, and the storage path for the diagnostic logs.

Notes

When using this plugin, be aware of the following limitations:

  • System Service Monitoring: If the process is monitored by systemd or a similar service manager, it will not be restarted by default unless allowRestart: true is set in the configuration. This is because systemd’s default KillMode also kills the helper process, causing the restart to fail.
  • Debugger Restriction: The plugin cannot be used while a debugger is attached.
  • Log Cleanup: Diagnostic logs are only appended to a temporary directory and are not automatically cleaned up; please check them periodically.
  • Plugin Hot Updates: Changes to the client bundle only take effect after the host process is restarted. This button cannot directly trigger a client bundle hot update.
  • No Port Scenario: If the host process does not bind a port, the helper process waits 1.5 seconds before starting the replacement.

Conclusion

dsh-simple-restart provides a standardized restart workflow, moving operational actions from the terminal to the browser UI and lowering the operational barrier. For scenarios that require frequent service restarts in development environments, it can significantly improve development efficiency.