DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-harness-restart

K

dsh-harness-restart

Discovered

One-click restart for DeepSeek Harness: a sidebar entry plus an out-of-process helper that quits and relaunches the desktop app.

dsh-harness-restart — 一键重启 DeepSeek Harness

在左侧栏的全局面板列表(Plugins、Market、Schedules 那一列)里加一个「重启」入口: 点一下,整个 DeepSeek Harness(桌面端是完整的 Electron 应用,CLI 是当前 dsh 进程) 会退出并自动重新启动。

重启这件事不能由被重启的进程自己完成,所以插件只负责准备计划,真正“杀进程 + 重新拉起” 的是一个进程外助手 helper.mjs:

  1. 插件先启动助手的第一段(stage 1),它立刻再启动一个 detached 的第二段(stage 2)后退出;
  2. stage 2 等待约 1.5 秒(让按钮的 HTTP 响应先回到页面),按计划终止应用进程;
  3. 等应用进程与 Host 进程都退出后,用原来的可执行文件和参数重新启动;
  4. 全过程写入 $DSH_HOME/dsh-harness-restart/logs/,失败时留下证据。

安装

这个目录本身就是一个 DSH bundle(dsh.bundle.patch 指向 cordis.patch.yml),没有构建步骤,也不需要 npm install:

  • 插件管理器:在 DSH 设置 → 插件里用「安装」选择这个目录,或调用 plugin_manager 的 install_bundle,target 指向目录的绝对路径;
  • CLI:dsh plugin --profile <profile> add file:<这个目录的绝对路径>。

装好后需要重启一次 DSH(这次可以手动重启;之后就可以用侧边栏里的「重启」了)。

用法

安装后刷新页面,左侧栏的面板列表里会出现一个圆形箭头 +「重启」的入口:

  • 点一下会打开重启面板并立即发起重启,没有任务时不需要第二次确认;
  • 有任务或后台作业在运行时:面板会变成确认页,点「停止任务并重启」才执行,可以「返回会话」取消;
  • 重启期间面板显示“正在重启 DeepSeek Harness…”,随后窗口自动关闭并重新打开;
  • 如果请求失败,面板会显示原因,并提供「重试」与「返回会话」。

如果应用没有自己回来

插件会在 $DSH_HOME/dsh-harness-restart/ 下生成双击即可启动的回退脚本:

  • start-deepseek-harness.cmd(Windows)
  • start-deepseek-harness.bat(同上)

日志在 $DSH_HOME/dsh-harness-restart/logs/,最近一次重启计划在 plans/。

自检

插件激活后会做一次自检(每个版本一次):

  • 检查 index.js、helper.mjs、client.js 的语法;
  • 检查控制接口能否返回状态;
  • 用一次真实的 终止 → 等待 → 重新启动流程拉起一个无害的 Node 进程(不碰应用本身);
  • 用 POST /dsh-harness-restart/restart?dry=1(只生成计划、不执行)验证按钮实际发出的请求: 合法桌面请求返回 200 与正确的 exe / killPids;缺 x-dsh-restart 头、跨站请求、异源 Origin 分别返回 403;有任务运行时 force=0 返回 409(确认卡片的数据来源)。

结果写入 dsh-harness-restart/preflight.json 的 selfTest 与 probes 字段,以及 self-test-<版本>.ok。dry=1 永远不会启动助手,可以随时用来做无副作用诊断。

配置

在 profile 的 cordis.patch.yml 里按行 id 覆盖:

- id: dsh-harness-restart
  config:
    delayMs: 1500       # 响应页面后等多久才终止应用(毫秒)
    graceMs: 12000      # 等应用与 Host 自行退出的最长时间(毫秒),超时强制终止
    selfTest: true      # 是否运行一次性的进程外自检
    allowRemote: false  # 是否允许非回环地址调用控制接口(默认只允许本机)

安全边界

  • 控制接口只接受回环 / 桌面壳同源的请求,并要求 x-dsh-restart: 1 请求头;
  • 跨站请求(Sec-Fetch-Site: cross-site 或不同源的 Origin)一律拒绝;
  • 重启默认会检查正在运行的 Agent 与后台作业,不会静默打断它们;
  • 重启计划($DSH_HOME/dsh-harness-restart/plans/*.json)会记录启动时的完整环境变量(原样重启所需),保存在 $DSH_HOME 下,可能包含令牌等敏感值——不要把这个目录提交到仓库或分享出去。

兼容性

  • 桌面端:process.versions.electron 存在时,重启应用主进程(DeepSeek Harness.exe)。
  • CLI:普通 Node 宿主下,用相同的 process.execPath 与 process.argv 重新启动当前进程。

Comments

Loading…

Similar plugins

dsh-restart-plugin

by StarMoon-win

Sidebar restart button for DeepSeek Harness Desktop: one click fully quits and reopens the app.

UI & ExperienceManifest valid

★ 0

MIT

JavaScript

Oct 20, 2026

dsh plugin --profile web add dsh-restart

by 13520rygvv

DSH desktop plugin: a one-click restart button in Settings, plus a customizable shortcut.

Tools & CapabilitiesUI & ExperienceManifest valid

★ 1

JavaScript

Oct 27, 2026

dsh plugin --profile web add @local/dsh-restart-button

by IHS470

DeepSeek Harness restart button in the DSH desktop window title bar

Development & InfrastructureManifest valid

★ 3

↓ 125/wk

MIT

JavaScript

Oct 3, 2026

dsh plugin --profile web add dsh-plugin-restart

by w17her

Reload, restart, or shut down the DeepSeek Harness desktop app from inside its window.

Manifest valid

★ 0

MIT

JavaScript

Oct 27, 2026

dsh plugin --profile web add @local/dsh-power-control

by PPsz-qqq

DeepSeek Harness plugin: one-click restart button in the top-right of the session header (Windows desktop + dsh web). 一键重启 DeepSeek Harness 客户端。

UI & ExperienceDevelopment & InfrastructureManifest valid

★ 5

↓ 50/wk

MIT

JavaScript

Oct 3, 2026

dsh plugin --profile web add dsh-restart-button

by zhouchengke2046

Independent one-click restart for DeepSeek Harness web (Settings page). · 独立的 DSH Web 一键重启插件。

Manifest valid

★ 0

MIT

JavaScript

Aug 19, 2026

dsh plugin --profile web add dsh-restart