dsh-restart
Manifest validOne-click restart for DeepSeek Harness: a sidebar glyph that closes and relaunches the entire application. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
dsh-restart
给 DeepSeek Harness 加一个「重启」按钮:点一下左侧栏的 ⟳,整个应用自动关闭并重新启动。
English — A one-click restart button for DeepSeek Harness. Click the ⟳ glyph in the sidebar panel list and the whole application closes and relaunches itself. Useful after installing or updating plugins, which only take effect after a restart. The desktop shell exposes no restart IPC to plugins (only
shutdown,quit-inspectionandupdate-tasks), so the restart is performed by a two-stage launcher that escapes the Electron job object — see 工作原理 below.
主要功能
| 一键重启 | 单击侧栏 ⟳ 图标立即重启,无二次确认,从点击到新窗口出现约 3–4 秒 |
| 可见即用 | 同时注册原生侧栏面板;若宿主不提供槽位服务,自动降级为右下角浮动按钮 |
| 不残留窗口 | 重启脚本以 conhost --headless 运行,不留下控制台窗口 |
| 失败可降级 | WMI 被禁用时自动改为「结束 Host」,由 Electron 弹出自带的重启确认框 |
为什么需要它
DSH 的插件更新之后需要重启应用才生效,但桌面版没有提供重启入口——主进程只接受 shutdown / quit-inspection / update-tasks 三种 IPC 消息,没有 restart,插件无法请求外壳重启。这个插件补上了这个入口。
兼容性
- DeepSeek Harness Desktop 0.2.1-rc.2(Windows 上验证通过)
- 其他版本与平台未验证
安装
dsh plugin --profile <profile> add dsh-restart
或把本仓库目录作为一个插件安装(file: 依赖),再把它加入 profile 的 dsh.profile.bundles:
- insert:
- id: dsh-restart
name: 'dsh-restart'
安装后需要重启一次 DSH,图标才会出现。
使用
点击左侧栏面板列表里的 ⟳ 图标即可重启——单击直接执行,没有二次确认。
重启期间当前会话会中断;DSH 的会话记录是持久化的,历史不会丢。
工作原理
重启必须交给一个不被 Electron 进程树连带清理的进程,因此分两级:
- Stage 1(运行在 Host 进程树内):通过 WMI
Win32_Process.Create启动 Stage 2。该调用由WmiPrvSE.exe创建进程,从而脱离 Host 所在的 Job Object——实测杀掉 Host 会连带清理其所有普通子进程。 - Stage 2(独立进程):结束 Electron 外壳、结束 Host、等待外壳真正退出(单实例锁随进程退出释放),再用
UseShellExecute启动应用,使新进程不依附任何控制台。
几个踩过的坑,都写在源码注释里:
spawn(..., { detached: true })会让powershell.exe启动约 70ms 后以退出码 0 结束,脚本根本不执行- WMI 返回
ReturnValue = 0不代表进程真的跑起来了,因此 Stage 1 通过日志握手确认 Stage 2 是否启动,未启动则降级为「结束 Host,让 Electron 弹出自己的重启确认框」 - WMI 创建的是无控制台进程,PowerShell 缺少控制台句柄时会启动即退,需要
conhost.exe --headless包装
已知限制
- 仅验证 Windows
- 依赖 WMI 可用(受限环境或组策略可能禁用)
- 如果 WMI 被禁用,会降级为「结束 Host」,此时 Electron 会弹出重启确认框,需要手动确认
License
MIT
Comments
Loading…
From the same category
by anywhere-labs
为 DeepSeek Harness (DSH) 插件生态打造的现代化桌面端解决方案。万物皆「插件」,桌面本身也是「插件」。
★ 36.7k
↓ 103/wk
MIT
TypeScript
Nov 24, 2026
dsh plugin --profile web add dsh-plugin-desktopby zhu1090093659
DeepSeek Harness (DSH) Web Plugin Aggregation Ecosystem · Everything is a plugin, distributed via the Creative Workshop
★ 10.6k
↓ 105/wk
Apache-2.0
TypeScript
Nov 24, 2026
dsh plugin --profile web add dsh-webA collection of independent Web UI plugins and skins, including task boards, Git graphs, mobile access, and live token stats.
★ 10.4k
↓ 105/wk
Apache-2.0
TypeScript
dsh plugin --profile web add dsh-webby PC2005-cloud
DSH 桌面宠物:一行命令装好即用的透明动画小桌宠,支持多开、大小位置随心配置;还内置 DIY 素材链,能用 AI 视频自造专属宠物
★ 6.7k
↓ 68.7k/wk
MIT
TypeScript
Nov 17, 2026
dsh plugin --profile web add dsh-petby bowenliang123
The best DeepSeek Harness plugin for context insight and management, with context dashboard / browser / sidebar and context command, for context statistics, composition, breakdown, evolution details,
★ 5.5k
↓ 115.8k/wk
Apache-2.0
TypeScript
Nov 24, 2026
dsh plugin --profile web add dsh-contextby omdsh-dev
开放的侧边栏底座,支持三方拓展注册新侧边栏页面。内置文件渲染编辑/终端/侧边对话/Git/子代理页面 | Open sidebar foundation, supports third-party extensions to register new sidebar pages. Built-in file rendering/editing, terminal, side chat, Git,
★ 5.3k
↓ 79.5k/wk
MIT
TypeScript
Nov 21, 2026
dsh plugin --profile web add dsh-better-sidebar