Preface¶
The desktop version of DeepSeek Harness is built on the Electron framework, and its process model differs from dsh web in a terminal. The desktop main process treats a host child-process exit as a failure and shows a “Launch failed” recovery dialog. At the same time, the desktop version does not provide an internal IPC channel to restart the main process. Therefore, this plugin uses an external helper process to bypass these limitations and restart the entire Electron application with one click.
Installation¶
Install it using the official plugin management command:
dsh plugin add @luoshuizhiwei/dsh-desktop-restart
After installation, restart the application to load the plugin.
Entries¶
The plugin provides five restart entry points, all invoking the same logic:
1. Top-left panel in the sidebar: Click the “Restart Desktop Application” button in the panel.
2. Sidebar bottom: Click the “Restart Desktop Application” button in the action row (requires two consecutive clicks).
3. Session title bar: Click the refresh icon on the right.
4. Slash command: Enter /restart-desktop in the input box and press Enter.
5. Settings page: Go to “Settings → General → Restart Desktop Application”.
Among these, the slash command and the settings page button execute directly. The sidebar and title bar buttons use two-step confirmation (arm first, then click again within 5 seconds).
State Guard¶
Before restarting, the current state is checked and handled in two ways:
* A task is running: It only issues a warning and requests a second confirmation; it does not force-block the restart.
* A plugin is installing/updating: It hard-blocks the restart. The check is whether the corresponding process is alive in profile/.plugin-manager/run.json, not whether the file exists. This prevents dependency corruption caused by forcefully restarting while pnpm is writing the dependency tree.
Auxiliary Features¶
The plugin also handles two UI and file cleanup issues:
* Clean up change snapshots: When the desktop Electron main process is force-killed, dsh-workspace-changes-* directories under the system Temp directory may remain. Ten seconds after the plugin starts, it scans that directory and only cleans directories that meet the following conditions: name begins with dsh-workspace-changes-, created before the current host launch, not written to since the host launch, and older than 24 hours. This feature is enabled by default.
* Hide the feedback entry: The “Feedback” button in the account menu has no ID. The plugin listens for DOM changes, matches the text content, and removes it. This feature is enabled by default and can be disabled in settings at any time.
License¶
This plugin is licensed under the MIT license. The source code is hosted on GitHub.