DSH Plugin: DeepSeek Harness Restart Button

Introduction

When developing with DeepSeek Harness, you sometimes need to restart the desktop app to load new configurations or fix certain states. Manually closing the window and reopening it is inefficient. The dsh-plugin-restart plugin provides a button in the window title bar; clicking it shuts down the entire app and restarts it. In addition, the repository includes a local tool that can add “Restart DeepSeek Harness” to the system tray menu. The runtime in plugin version 2.0.0 is the original v0.1.0 runtime (byte-for-byte identical).

Components

The plugin consists of two parts: the runtime (the plugin itself) and the patch tool.

  • Plugin (runtime): Adds a restart button to the window title bar. Clicking it performs the sequence: “kill shell → relaunch app → raise window twice”. This component does not provide a settings page, nor does it include a locking mechanism.
  • tools/patch-shell-tray.mjs: Adds a “Restart DeepSeek Harness” item to the desktop shell’s tray menu. This item uses the shell’s own app.relaunch() + quitWithoutConfirmation() logic. Electron removes the tray icon itself, so no ghost icon is left behind.

Installation and Enablement

The plugin itself can simply be installed as a DSH plugin:

# 作为 DSH 插件安装即可

Tray Tool Usage

The tray patch is not provided by the plugin; it is a local, reversible shell patch tool. It must manipulate the app.asar file directly. The tools/patch-shell-tray.mjs script in the current directory supports the following commands:

# 检查已安装的 asar 是否带补丁
node tools/patch-shell-tray.mjs status

# 从原始备份生成暂存包并逐文件校验
node tools/patch-shell-tray.mjs build

# 45 秒后由 WMI 创建的独立进程完成切换(推荐)
node tools/patch-shell-tray.mjs detach

# 立即切换
node tools/patch-shell-tray.mjs swap

# 还原原始 asar 并重启
node tools/patch-shell-tray.mjs revert

Notes

  • Windows only: The plugin has been verified on Windows.
  • Permission limitations: The tray patch cannot be provided directly by the plugin. Because the tray menu lives in the desktop shell’s main process (Electron API), while the plugin only has two attachment points—the host (pure Node, no Electron API) and the page (preload only exposes the fixed dshDesktop)—it cannot add any item to the tray menu.
  • Ghost icons: Restarting via the title bar button is a process-kill restart. Windows may leave a ghost tray icon for a forcibly killed process; the tray item does not behave this way.
  • App updates: Vendor-packaged apps (such as reinstalling or updating) overwrite app.asar. At that point, rerun build + detach to apply the patch.

Summary

The plugin provides the ability to quickly restart DeepSeek Harness. Combined with the tray patch tool, you can restart the app directly from the system tray. Keep in mind the Windows limitation and the need to reapply the patch after app updates.

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

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

Xiaoye