DeepSeek Harness plugin

dsh-web-restart

Ensure or rotate the DSH web server (detached) when this bundle is loaded in a profile

Jump to install

Source facts

Repository
LnsiAxe/dsh-web-restart
Latest update
Aug 14, 2026
Category
Tools & Capabilities
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/LnsiAxe/dsh-web-restart
Plugin: dsh-web-restart
Author: LnsiAxe

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-web-restart

一个 DeepSeek Harness (dsh) bundle 插件: 确保 / 重启 dsh web 服务。加载即生效——服务挂了自动拉起;需要换新代码时一键脱管重启。

背景

dsh 的 agent 运行在 web 服务进程内部。如果 agent 直接 Stop-Process 杀掉 web 服务, 等于杀掉自己所在的进程树,重启命令永远执行不到后半段("自杀式重启")。 本插件通过 WMI Win32_Process.Create 把新服务进程创建在 WMI 宿主下, 完全脱离 agent 进程树,重启后依然存活。

功能

模式 (mode)行为
ensure(默认)端口未监听 → 脱管启动 web 服务;已监听 → 不动
rotate已监听 → 脱管重启(等调用方返回后 kill 再拉起);未监听 → 直接启动

另外支持 flag 文件触发重启:在 web profile 内运行时(此时服务必然在跑), 创建 <DSH_HOME>/dsh-web-restart.flag,下一个会话回合开始时插件会删除 flag 并脱管重启服务, 用于加载新插件/新代码。

安装

# Install from npm (requires dsh >= 0.1.0-rc.6)
dsh plugin --profile headless add @lnsiaxe/dsh-web-restart   # 服务挂了之后,跑一次 headless 任务即可复活 web 服务
dsh plugin --profile web add @lnsiaxe/dsh-web-restart        # 启用 flag 触发重启

# Restart dsh web; the plugin activates on boot
dsh web

本地开发(fork 修改后自用):

dsh plugin --profile headless add file:<你的插件目录>
dsh plugin --profile web add file:<你的插件目录>

使用

# 服务挂掉后:headless 启动,插件在 boot 时自动拉起 web 服务
dsh --profile headless "启动 web 服务"

# 在 web profile 里请求重启(换新代码后):
#   1) 创建 flag:  New-Item C:\Users\<you>\.dsh\dsh-web-restart.flag
#   2) 发一条消息触发新回合 → 插件自动脱管重启

配置(cordis.patch.yml

- insert:
    - id: web-restart
      name: '@lnsiaxe/dsh-web-restart'
      config:
        port: 3080        # web 服务端口
        mode: ensure      # ensure | rotate
        # workspace: C:\Users\<you>\my-workspace  # 可选,默认取进程 cwd
        # gitDir: C:\Users\<you>\git\cmd  # 可选,默认 ~\git\cmd(给 side-panel 的 git 用)

工作原理

1. 激活时把 dsh-web-restart-launch.cmd / dsh-web-restart-rotate.cmd 生成到 DSH_HOME: - launch.cmd:设置 DSH_HOME/PATH(含 git),cd 到工作区,以 node …\lib\bin.js web --port <port> 前台运行并重定向日志 - rotate.cmdping 延时让调用方安全返回 → kill 3080 监听进程 → 调用 launch.cmd 2. 通过 powershell Invoke-CimMethod Win32_Process.Create 启动脚本——新进程父进程是 WMI 宿主, 不在 agent/服务进程树内,因此不受进程树回收影响。 3. 服务本身在 web profile 里加载本插件时(argvweb),自动跳过自重启,仅响应 flag。

非 Windows 平台回退为 spawn(..., { detached: true }).unref()

相关

  • dsh-side-panel:本插件的配套面板(Git 审查 / 文件 / 终端)。

它曾有一个"打开面板后聊天区消失"的布局 bug(issue #1), 可参考该 issue 的修复思路。

许可证

[MIT](LICENSE)