dsh-plugin-restart: One-Click Restart for DeepSeek Harness

Introduction

DeepSeek Harness (DSH) uses an “everything is a plugin” architecture. Changes to plugins or the Host usually require the app to be restarted before they take effect. On the desktop client, the “Restart App and Host” option in the official menu is not exposed in official releases, so developers or users cannot directly trigger a restart from the UI.

This section introduces the dsh-plugin-restart plugin. It uses a sidebar button and a detached watchdog script to provide one-click restart for the entire desktop app (Electron shell + Host), allowing locally built plugins or configuration changes to take effect immediately.

Core Features

This plugin provides the following verified capabilities:

  • Sidebar restart button: Adds the ui-dsh-restart icon button (order: 10) to the icon row with the avatar/settings in the bottom-left corner. Clicking it opens a confirmation panel.
  • Process-detached watchdog: Uses WMI (Win32_Process.Create) to create a child process, ensuring that the watchdog script continues running after the main process exits and can start a new application instance.
  • Tray menu support: Provides an optional Windows tray entry, allowing the app to be restarted or started without relying on the UI.
  • Status self-check and dry run: Provides HTTP APIs for querying status and performing Dry-run checks without side effects.

Installation and Enabling

Installing this plugin requires access to the desktop CLI or the plugin manager.

  1. Install in DSH (recommended):
    Use plugin_manager install_bundle, with the target set to the absolute path of the repository.
    plugin_manager install_bundle target=<你克隆这个仓库的路径>
  1. Use the desktop bundled CLI:
    Call the dsh command to add the plugin to the current profile.
    $dsh = "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd"
    & $dsh plugin --profile desktop add "<你克隆这个仓库的路径>"

First-Run Configuration

The Host-side restart route requires manual bootstrap after initial installation before it can take effect.

  1. Add the configuration item to $env:USERPROFILE\.dsh\profiles\desktop\cordis.patch.yml:
    - id: dsh-plugin-restart
      config:
        dryRun: true
  1. Restart the app first. At this point, clicking the button only returns the plan and does not actually restart the app.
  2. Confirm that the status API returns normally, then remove the dryRun: true configuration item. After that, each click of the button can perform a real restart.

Usage

After installation and the initial configuration are complete, the regular workflow is as follows:

  1. Rebuild the plugin locally (for example, run pnpm build).
  2. Click the “Restart DSH” icon at the bottom of the sidebar and select “Restart Now”.
  3. The app exits automatically and restarts within seconds; after the page reconnects, the current session continues.
  4. If the app does not come back automatically, check the %USERPROFILE%\.dsh\dsh-plugin-restart\restart.log and restart-result.json logs.

Technical Implementation and Notes

This plugin is designed around the behavior of Electron apps on Windows. Note the following facts:

  • Windows only: It depends on Get-Process, Start-Process, taskkill, and WMI, and does not support Linux or macOS.
  • PowerShell 5.1 is required: The plugin runtime uses the system PowerShell (powershell.exe), and PowerShell 7 (pwsh) is not supported.
  • Process termination order: The Electron main process must be terminated individually first, then child processes such as the Host. Otherwise, Electron will treat the Host exit as a crash and show the “DeepSeek Harness is not available” dialog.
  • No hot reload: Host-side code changes only take effect after restarting the process; the plugin itself cannot implement hot reload.

Uninstallation

If you need to remove the plugin, use the following command:

& $dsh plugin --profile desktop remove dsh-plugin-restart

GitHub: https://github.com/SOH4C4759/dsh-plugin-restart
Directory page: https://www.skillhub.cn/plugins/SOH4C4759/dsh-plugin-restart

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye