RoyougiShiki/dsh-restart-systemd ↗★ 0
dsh-restart-systemd
WebUI restart button (systemd) for DeepSeek Harness: a sidebar-footer restart trigger + /restart command that schedules `systemctl --user restart dsh-web`, with single-flight dedup, a loopback security fence, and automatic session resume (agent/created -> followup continue) after the service comes back up. WSL/Linux primary; Windows falls back to a detached spawn helper.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:RoyougiShiki/dsh-restart-systemd说明文档
阅读完整 README ↗dsh-restart-systemd
English summary. A DeepSeek Harness WebUI restart button (systemd edition). Adds a sidebar‑footer restart trigger next to the remote‑web‑ui phone icon plus a
/restartcommand. Clicking schedulessystemctl --user restart dsh-web(~3s later, so the browser gets its 202 first), dups are refused (409), non‑loopback callers are refused (403), a flag‑file + residual‑window design prevents restart loops, and after the service comes back up the browser auto‑reconnects without a manual refresh (ConnectionController exponential backoff 500ms→10s) while interrupted agent turns are auto‑resumed. Platform: WSL/Linux → systemctl --user (primary, tested); Windows → detached helper branch is present but unused on WSL.
GitHub topics(主代理创建仓库时使用): dsh · dsh-plugin · restart · systemd
设计总览
双面插件(与 dsh-client-ui-aionui-panel 同构):
| 半边 | entry(exports) | 运行环境 | 职责 |
|---|---|---|---|
| host | "." → lib/index.js | node(宿主导进) | /api/restart-dsh 路由、/restart 命令、flag/resume 状态、restart-recover |
| client | "./client" → lib/client.js | 浏览器(WebUI) | 侧边栏 footer 重启按钮 + 二次确认 + 状态反馈 |
src/
index.ts # host apply():串联路由 + 命令 + boot 消费/resume
host/gate.ts # loopback fence(照抄 dsh-aionui-panel 的 gate)
host/restart.ts # 调度 + 延迟 spawn + 平台分支 + flag/单飞锁
host/recover.ts # agent/created -> lastTurnInterrupted -> followup continue
client/index.ts # client apply():locale + sidebar.footer.action 注入
client/RestartButton.tsx # 按钮 + 确认对话框(内联样式,无需 CSS bundle)
client/api.ts # POST 助手 + 重连探活
内部依赖:官方 socket sidebar.footer.action(list/root additive,remote-web-ui 电话图标同座)+ 备选 conversation.session.header.utilities。