dsh-macos-restart
Manifest validmacOS 桌面版一键重启 / One-click restart for the DeepSeek Harness desktop app.
macOS Desktop Restart (dsh-macos-restart)
English | 中文
macOS 桌面版一键重启 / One-click restart for the DeepSeek Harness desktop app.
A macOS-only one-click restart for the DeepSeek Harness desktop app. It
handles the Electron app itself, not a dsh web host: the restart is for making
plugins that cannot hot-reload load on the next launch.
Scope
This plugin is for the macOS Desktop app. It is not a generic header control
and not a dsh web restart button:
- It stops the Electron main process, lets the desktop host exit through its
own IPC-disconnect path, waits for the old web port to be released, and runs
open -aon the.app. - It does not support Windows, Linux,
dsh web, or a standalonedshCLI. - It deliberately does not add a quit/exit action; macOS already has Cmd+Q. The value here is the automatic relaunch, the running-turn check, and the plugin-install gate.
The community plugin dsh-header-controls also puts restart/exit buttons in the
conversation header, but its documented mechanism is a dsh web launcher +
Windows taskkill/netstat flow. It does not restart the macOS Electron app.
The two plugins overlap only at the header-seat level.
Entry points
- Title-bar icon in the top-right Session header. On by default.
- Sidebar-foot icon beside Settings. Off by default; enable it in Settings.
- Settings → Desktop Restart: status, last restart, logs, entry-point switches, and the restart button.
/restart-desktopcommand. Add--forceto restart while a turn runs.- Optional draggable floating button, off by default, position remembered.
The header, sidebar, floating button, Settings page, and command all call the same Host operation.
How it restarts
- The Client sends
POST /plugins/dsh-restart/restartwith{ "confirm": true }. - The Host checks loopback/same-origin, that this is the macOS desktop host, that no plugin install/update is running, and whether a turn is running.
- The Host writes a handoff record and an initial
state.json, then starts an independent one-shot opener as a detached/bin/sh. The opener only waits and opens; it never kills. Do not uselaunchctl submitfor this: in a real 0.1.4 test the submitted job restarted the opener every ~10s after the app was back. - The Host starts the killer helper. It sends SIGTERM to the Electron main process. The app may show its own quit confirmation for scheduled tasks; choosing Quit lets it flush account/session state. The host is a separate child: it sees the IPC channel close and runs its own graceful shutdown, so session logs still land. The helper never escalates a normal restart to SIGKILL — Cancel must really cancel, and an unanswered dialog must not be silently killed. Only the explicit stale-manager advanced path uses SIGKILL, with its own warning.
- The opener/killer wait for the old main process to disappear and for the web
port to be released, then run
open -a "/Applications/DeepSeek Harness.app".open -aon an already-running app activates it, so the two helpers cannot start two instances. - If the host refuses to exit it is escalated. Failure is reported with a
dialog and a log under
~/.dsh/dsh-restart/.
Diagnostics
~/.dsh/dsh-restart/state.jsonrecords the last restart's phase:queued → opener-started/killing → waiting-host → host-exited → waiting-port → port-free → opening → opened(orfailed).- Settings shows the last phase/time and one Reveal latest log button.
POST /plugins/dsh-restart/open-logsdoes the same from the Host, so it works even when the page has lost its connection. It usesopen -R(Finder reveal) because plainopen <file>.logdepends on a default application and can look like a no-op. - The helper log contains the process-level account; the state file is the short version that survives a torn-down process tree.
Stuck install recovery
If the plugin manager holds its install lock with no pnpm/install progress for
five minutes, pluginOperation.stale becomes true and the dialog offers
Force restart (advanced). It is only available while the lock belongs to
the current host, or when no manager lock exists at all; a live pnpm process is
never bypassed. A force restart kills the host, releases the lock, and reopens
the app — an unfinished install is interrupted, and because it bypasses the
app's own quit confirmation the main process may skip its final account/window
state flush. Use it only when the manager is actually stuck.
Safety
- Only loopback requests are accepted. The desktop document proxy may strip both
Host/Origin, or onlyOrigin; a loopbackHostwith noOriginis accepted, and a presentOriginmust matchHost.sec-fetch-site: cross-siteis rejected. - A running turn returns
409 busy; the Client lists the affected session ids and asks for a second confirmation before sendingforce: true. - A plugin install/update returns
423. The only exception is the explicit advanced force path for a stale manager lock described above. allowRestart: falseincordis.patch.ymldisables the operation.- The plugin never modifies
app.asarand never starts a second server.
Configuration
- id: dsh-restart
name: 'dsh-macos-restart'
config:
allowRestart: true
Files
lib/index.js— Host routes (/status,/restart,/open-logs), gates, command, state, helper/opener scheduling.lib/helper.sh— detached killer/opener helper (--dry-runsupported).lib/client.js— title-bar icon, sidebar action, Settings page, modal, floating button, log actions.locale/{en,zh}.json— Plugin Manager display metadata.README.zh.md— Chinese README.PUBLISHING.md— npm + curated-catalog release checklist.
Publishing
See PUBLISHING.md.
The current package name dsh-macos-restart is a local development name; the
publishable artifact is dsh-macos-restart on npm.
Comments
Loading…
Similar plugins
by yxccai
Unofficial Windows and macOS desktop app for DeepSeek Harness, with bundled runtime and automatic reuse of existing DSH environments.
★ 11
↓ 264/wk
MIT
JavaScript
Aug 21, 2026
dsh plugin --profile web add @sanqi-normal/dsh-webui-market-pluginby wangzhuoyuan229-source
macOS desktop launcher for DeepSeek Harness — Chrome, custom transparent icon, and installation skill
★ 0
Shell
Sep 23, 2026
dsh plugin --profile web add dsh-deepseek-launcherby StarMoon-win
Sidebar restart button for DeepSeek Harness Desktop: one click fully quits and reopens the app.
★ 0
MIT
JavaScript
Oct 20, 2026
dsh plugin --profile web add dsh-restartby IHS470
DeepSeek Harness restart button in the DSH desktop window title bar
★ 3
↓ 55/wk
MIT
JavaScript
Oct 3, 2026
dsh plugin --profile web add dsh-plugin-restartby SakuraYH1080
One-click Quick Restart for DSH Desktop: quits and relaunches the app from the account menu.
★ 0
MIT
JavaScript
Oct 22, 2026
dsh plugin --profile web add dsh-quick-restartMaximizes the DeepSeek Harness desktop window automatically on startup, equivalent to clicking the maximize button once. Cross-platform (Windows/macOS/Linux), best-effort, host-only.
★ 0
dsh plugin --profile web add dsh-auto-maximize