在「设置」上方添加「重启 dsh」按钮,原地重启:以 systemd 单元运行时由 systemd 重启,否则通过 process.execve 保持同一 PID(Windows 或 Node < 22.15 时保留一个轻量父进程),启动 dsh 的守护进程或终端无需额外配置(已在 Linux 实测,Docker、macOS、Windows 尚未实机测试);新 boot id 响应后页面自动刷新。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-restart-anywhere
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:JoblessJoe/dsh-restart-anywhere
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness (dsh) web GUI plugin that adds one small Restart dsh button above Settings. It is for the moments you need a restart: you installed a plugin, changed a config, or fixed a bug in your own plugin.
Agents can do it too. A dsh_restart tool lets an agent restart dsh after installing or editing a plugin. With a continue_prompt, it is woken in the same session once dsh is back and carries on.
It works with your setup. systemd, Docker, Kubernetes, pm2, a tmux pane, a plain terminal or Windows: click, and dsh is back in a few seconds. The page reloads by itself.
npx @deepseek-ai/dsh plugin --profile web add dsh-restart-anywhere
Works with your setup
Most restart buttons kill dsh and hope something starts it again. That only works for the setup their author had. A detached "relaunch me" helper gets killed along with a systemd service. A clean exit doesn't trigger Restart=on-failure. A container without a restart policy just stops. And under pm2 or runit, the helper and the supervisor both start dsh and fight over the port.
dsh-restart-anywhere doesn't hand dsh's life to anyone else. It restarts dsh in place:
| Your setup | What happens | Leaves behind |
|---|---|---|
systemd (user or system unit, any Restart= policy) |
Asks systemd to restart the unit, so you get a fresh process, exactly like systemctl restart. If that's not permitted (a system unit, no root), it falls back to in-place. |
nothing |
| Docker / Podman / Kubernetes (with or without a restart policy) | In place: same PID, so the container never notices. | nothing |
| pm2, supervisord, launchd, runit, s6, nssm, forever, … | In place: the supervisor keeps seeing the process it started, still running. | nothing |
| Terminal, tmux, screen, nohup | In place: same PID, and the new dsh keeps printing to the same terminal. Ctrl-C still stops it. | nothing |
| Windows / Node < 22.15 | Wrapper: the old process stays as a thin parent of the new dsh. It forwards Ctrl-C and exits with dsh's exit code. | the parent process |
| dsh desktop app | Button hidden: the app manages its own lifecycle. | n/a |
No supervisor detection, no config, no root, no helper scripts.
How it works
- Graceful shutdown. The plugin calls dsh's own exit hook (
ctx.appExit). Every plugin tears down exactly as on a normal quit, and sessions are flushed. - The process becomes the new dsh.
- Linux / macOS, Node ≥ 22.15:
process.execve()swaps the process image for a fresh dsh with the same command line, environment and stdio. The PID doesn't change, and nothing is left behind. - Windows / older Node: the process stays alive as a small wrapper and starts the fresh dsh as its child. Later restarts reuse the same wrapper, so there's never more than one.
- systemd: systemd restarts the unit itself, via a one-second transient timer, so the HTTP reply reaches your browser first.
- Linux / macOS, Node ≥ 22.15:
- The page reloads. The browser polls until a server with a new boot ID answers, then reloads. That works however fast or slow the restart is.
Details that make it hold up:
--port 0: a random port is pinned on restart, so the page finds dsh again.- No browser-tab spam:
--no-openis added on relaunch. - Double clicks: a second request while a restart is running gets
409.
Install
Into your dsh web profile (web below is the profile name; use whichever profile backs your web GUI). From a source checkout, use pnpm dsh instead of npx @deepseek-ai/dsh:
npx @deepseek-ai/dsh plugin --profile web add dsh-restart-anywhere
This installs the package into the profile and adds it to dsh.profile.bundles. Reload the browser tab, and Restart dsh shows up above Settings. If it doesn't, restart dsh one last time the old way. From then on, the button does it.
Requires dsh 0.2.0 or newer and Node 20+. There's no build step and no runtime npm dependencies.
Using it
Click Restart dsh and confirm. The icon spins while dsh restarts, and the page reloads when the new dsh is up, usually within about 5 seconds.
Running agent sessions are interrupted by a restart, like with any restart. The confirmation dialog says so.
For agents: the dsh_restart tool
Agents get the same restart as a tool, e.g. after installing or editing a plugin they want to test.
dsh_restart({ continue_prompt? }): restarts dsh exactly like the button.continue_prompt: once dsh is back, the agent is woken in the same session with this text as its next instruction. Leave it out and the session just stays stopped.- Root sessions only: subagents don't get the tool.
- A wake older than 5 minutes is dropped, so a restart that never happened can't wake a session later.
Security
- Login required: the restart route is registered through dsh's own
/apiconnection layer (ctx.connection.fetch). It only answers browsers that are logged in to your dsh, and dsh's Host/Origin fence applies. - Exposed instances are safe: on an instance reachable from the internet, an unauthenticated request gets
401and can't restart anything. - No shell commands: nothing is run through a shell. The only external program is
systemd-run, and only when dsh is a systemd service.
Tested
Verified live with dsh 0.2.0 on Linux:
- systemd: user unit, with
Restart=noandRestart=on-failure. - systemd fallback: in place, when
systemd-runis unavailable. - Plain terminal: in place via
execve, three restarts in a row, then Ctrl-C and SIGTERM. - Wrapper path: Node without
execve, three restarts in a row, then Ctrl-C. - Supervisor that only restarts on failure: dsh stays up and the supervisor never notices.
--port 0, and two clicks at once.dsh_restarttool: an agent calls it with acontinue_prompt, under systemd and in place viaexecve. Both times it was woken in the same session within seconds and finished the task. The session still reloads cleanly afterwards.
macOS uses the same execve path as Linux, and Windows the same wrapper path as old Node. Neither has been run on real hardware yet, so reports are very welcome.
npm test runs the setup detection and command-line checks, plus the agent tool and wake-up logic against a fake dsh.
License
MIT
中文简介 · DeepSeek Harness (dsh) Web 界面插件:侧边栏「设置」上方的一个小小的「重启 dsh」按钮,适用于你的部署方式 —— systemd、Docker / Podman、Kubernetes、pm2、supervisord、launchd、终端 / tmux / nohup、Windows。原地重启(进程 PID 不变),无需检测或配置守护进程,重启完成后页面自动刷新。Agent 也能用:
dsh_restart工具重启 dsh,并可在 dsh 恢复后用continue_prompt唤醒同一会话继续工作。零运行时依赖,无需配置。安装:npx @deepseek-ai/dsh plugin --profile web add dsh-restart-anywhere
链接
同类插件
yjh051108/dsh-routing-suite★ 7027
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3950
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
first-fluke/oh-my-agent#dsh★ 1494
在工具执行前后以及尝试结束当前轮次时运行项目 OMA 检查。随插件安装 OMA CLI 依赖,并在首次使用时初始化未配置的项目。需要 Node.js 22+;首次初始化需要网络连接和项目目录写入权限。
MichengAI/dsh-skills-manager★ 631
在设置里管理本地 DSH 技能,并只读查看公共 Agent 技能。
hust-open-atom-club/oh-dsh★ 326
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
Fishquito7/dsh-skill-mcp-panel★ 291
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。