Introduction

In the development and maintenance of DeepSeek Harness (DSH), code updates or exception handling in the host process (dsh web) often require restarting the service to take effect. In the past, this usually meant switching back to a terminal window and manually running the restart command. The dsh-restart plugin moves this process to the Web GUI. By combining a Web button with a background helper process, it provides a graphical way to perform restarts and offers a standalone recovery console if a restart fails.

Plugin Positioning

dsh-restart is a workflow plugin maintained by zhengjy01 and released under the MIT license. It does not execute restart logic directly inside the host process. Instead, it delegates the restart task to a detached helper, which is triggered from the Web interface and automatically handles page reconnection, log capture, and error recovery.

Core Features

The plugin mainly provides the following capabilities:
* One-click restart via Web GUI: Provides a “Restart” card and a sidebar entry in the settings panel, allowing users to manually click to restart immediately.
* Manual approval gate: Enabled by default. When an agent invokes the restart tool, it only submits a request instead of performing the restart. The restart is executed only after the user clicks “Approve and Restart” in the panel.
* Automatic detection strategy: Depending on whether the host process is a launchd job, it automatically chooses between delegating via launchctl kickstart or directly restarting the same command.
* Standalone recovery console: Starts a helper service at http://127.0.0.1:3099. Even if the main DSH process crashes, this console remains available and displays startup logs and error messages.
* Agent tools: Provides two tools: dsh_restart_status (read-only status query) and dsh_restart (submit a restart request).

Installation and Activation

Run the following command to install the plugin:

dsh plugin --profile web add github:zhengjy01/dsh-restart

After installation, restart DSH once to load the plugin. You can then see the “Restart” card under “Plugin Settings → Web Plugins” in the settings panel, or see the restart icon in the left sidebar.

Typical Usage

1. Manual Restart

  1. Open the “Settings → Plugin Settings → Web Plugins → Restart” panel.
  2. Click the “Restart Now” button.
  3. The page displays the restart phase and elapsed time, and automatically reconnects after the new process starts.

2. Agent-Triggered Restart (Manual Approval Required)

  1. The agent calls the dsh_restart tool in the conversation.
  2. The tool does not restart immediately. Instead, it creates a pending approval request (stored in ~/.dsh/dsh-restart/pending-approval.json).
  3. The user sees a red confirmation card in the panel, which includes the request reason and a countdown timer.
  4. After the user clicks “Approve and Restart,” the restart is executed.

Notes

  • Permissions and authorization: The agent tool dsh_restart requires the caller to declare confirm: true, but this is only a self-asserted declaration. Manual approval is enabled by default, so the agent cannot bypass the user’s click to restart the host directly.
  • Console persistence: The helper process’s recovery console (127.0.0.1:3099) uses an independent port. Even if the main DSH process exits, the console remains available, making it easier to investigate startup errors.
  • History records: Restart history records are stored under the ~/.dsh/dsh-restart/history.. directory.