rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:dengnianchen/dsh-restart
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Restart the DeepSeek Harness Host from the Web GUI — one row in Settings → General and one entry in the sidebar account menu. Both surfaces restart the Host through its systemd user service when the process runs under one, and fall back to relaunching its own command line otherwise.
plugin_manager install_bundle @dyapple/dsh-restart
Requires DeepSeek Harness ≥ 0.2.1-rc.3 (uses ctx.connection.requestRejection and the settings.general.item slot).
| Surface | Where | Implementation |
|---|---|---|
| Settings row | Settings → General, after “Performance & usage” | Official settings.general.item slot, order: 35. Row shell follows the host's own General rows. |
| Account menu entry | Settings / Feedback / **Restart dsh** / Sign out |
DOM bridge — see limitations. |
| Agent tool | dsh_restart({ delayMs? }) |
Same operation as both UI entries. |
Sidebar footer icon, host files, and the profile's hand-written config are untouched: this is one ordinary bundle plugin (a Host half plus a Web half).
Click again to confirm, auto-expires after 4.5 s).Restarting…./dsh-restart/status every 0.7 s and reloads itself only when the Host answers with a different pid — a brief disconnect during the restart is never mistaken for success.Running turns and terminals are interrupted; sessions, transcripts and settings persist.
INVOCATION_ID plus an ordinary .service in /proc/self/cgroup, and systemd-run --user available): a detached transient unit runs systemctl --user restart <unit> after the delay.
Calling systemctl restart from inside the process does not work here: dsh-web is KillMode=control-group, so the restart would kill the helper itself. A transient unit lives in another cgroup./bin/sh waits for the old pid to disappear, lets the port settle, then execs the same command line while the old process exits.Both paths delay first, so the HTTP response reaches the page before the Host goes down.
| Route | Method | Purpose |
|---|---|---|
/dsh-restart/status |
GET | {ok, version, pid, mode, unit, command, startedAt, uptimeMs, restarting} |
/dsh-restart/restart |
POST | Body {delayMs?}, default 700 ms |
Both first pass ctx.connection.requestRejection() — Connection's Host/Origin fence plus the signed browser cookie — and the POST additionally requires content-type: application/json, which a cross-site simple request cannot send. Without a cookie both answer 401.
The account menu's items are a hardcoded array inside @deepseek-ai/dsh-client-ui-settings-account; it exposes no slot for extra rows, and its only seat (settings.launcher) is single-valued — taking it would replace the entire account menu. So this entry is a DOM bridge: it watches [role="menu"] nodes, identifies the account menu by requiring both the Settings and Feedback labels, clones the shipped Settings row (inheriting its classes, geometry and hover styles), swaps the glyph and label, and inserts it before Sign out / Sign in.
WeakSet prevents duplicates).git clone https://github.com/dengnianchen/dsh-restart.git
plugin_manager install_bundle ./dsh-restart
The profile links the checkout, so client.js reloads through HMR while index.js needs a Host restart (which is what this plugin does). The Host half is a single ESM module — one import per process.
dsh_restart 工具。systemctl --user restart <unit>(服务是 KillMode=control-group,进程内直调会把自己一起杀掉);没有 systemd 时 detached /bin/sh 等旧进程退出后 exec 同一条命令行。/dsh-restart/status,只有 pid 变了才 reload,120 秒没回来则报错并可重试。MIT © Nianchen Deng
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。