DeepSeek Harness Plugin: dsh-safe-restart

Preface

The desktop tray menu of DeepSeek Harness (DSH) only offers two options: “Open App” and “Quit.” After modifying plugins or configurations, the only way to see changes take effect is to quit and manually reopen the app, which interrupts running tasks and risks losing unsaved sessions. This plugin adds a “Restart DeepSeek Harness” option to the tray menu. If tasks are running, it first pops up a native confirmation dialog, and only executes the restart after confirmation.

What Is This

dsh-safe-restart is a client plugin that adds a “Restart” function to the DeepSeek Harness desktop tray menu. Developed by maintainer InsaneGenji, the current version is 0.1.2, and it is released under the MIT License. It works by modifying the client’s main.js file to insert a “Restart” item into the tray menu, and checks whether tasks are running before restart using the official quit logic.

Core Features

The core function of this plugin is to provide a “safe restart” entry point:

  • When tasks are running, it first displays an Electron native confirmation dialog. The title and buttons both show “Restart,” and it reuses the official prompt: “The currently running task will be interrupted.”
  • When no tasks are running, it executes the restart directly without showing a confirmation dialog.
  • The logic for determining “whether tasks are running” is identical to the official tray’s “Quit” function, using backend.host.inspectQuit() and resolveDesktopQuitPrompt() for the check.

Installation and Activation

Install from the plugin marketplace, or use the command line:

dsh plugin --profile desktop add dsh-safe-restart

After installation, you must restart DSH once for it to take effect. Use the tray “Quit” option and reopen, or restart DSH through other means. The patch is written into main.js when the host plugin starts. Since the main process code is already in memory, a manual restart is required to load the new code. After that, simply click the “Restart” item in the tray to use it.

Typical Usage

After installing and restarting DSH, right-click the DSH icon in the system tray. A “Restart DeepSeek Harness” item will appear in the menu. Clicking it will, if tasks are currently running, pop up a confirmation dialog:

  • Title: Restart
  • Buttons: Restart, Cancel
  • Prompt: The currently running task will be interrupted

After confirmation, DSH will restart and resume operation. If no tasks are running, clicking will restart directly without showing a confirmation dialog.

Use Cases and Notes

  • Suitable for users who need to frequently restart DSH to verify configuration changes or plugin updates.
  • The plugin runs with the permissions of the current DSH process. Review the source code and license before installing.
  • Currently only supports the Windows desktop client (the tray menu is in the process.platform === "win32" branch). On macOS / Linux, the plugin can be installed but will not apply the patch; the settings page will display “not supported.”
  • If the client is in a packaged state (i.e., resources/app.asar exists but the resources/app directory does not), the plugin cannot modify main.js. You must first unpack the asar into a local directory structure.
  • The plugin checks the structure of main.js on every startup. If it detects a clean official structure, it will automatically re-apply the patch. If a new version’s structural changes cause anchor mismatches, the plugin will skip and log the issue without damaging the client.

Ecosystem Context

DeepSeek Harness follows the “everything is a plugin” philosophy, extending functionality through plugins. dsh-safe-restart is a community directory client plugin with no official affiliation with DeepSeek or High-Flyer (幻方).

Revert Before Disabling

The “Restart” item in the tray is implemented through code injected into main.js. Before disabling or uninstalling the plugin, it is recommended to click “Revert Patch” in the settings page first. Otherwise, a non-functional “Restart” item will remain in the tray. The revert operation is a byte-level restoration and can be re-applied at any time.

Short Closing

This plugin solves the problem of “having to quit and reopen just to apply config changes” on the DSH desktop client, providing a smoother restart experience. After installing and restarting DSH, you can use the “Restart DeepSeek Harness” function directly from the tray menu.

  • Plugin directory page: https://www.skillhub.cn/plugins/InsaneGenji/dsh-safe-restart
  • GitHub repository: https://github.com/InsaneGenji/dsh-safe-restart
羽毛球分组比赛记分
小程序二维码

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

Xiaoye