edusrez/dsh-smart-restart ↗★ 1
dsh-smart-restart
DSH host plugin that detects when the DeepSeek Harness service has restarted and wakes the main agent at boot with a notice, so interrupted work can be resumed.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:edusrez/dsh-smart-restart说明文档
阅读完整 README ↗Configuration
All behavior is controlled through the plugin row's config:
| Key | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Master switch; false skips all processing. |
stateDir | string | .smart-restart | Sub-directory under `` where marker.json, pending-notice.json and shutdown-notice.json are written. |
target | string | primary | Which agent(s) to notify when there is no pending/shutdown notice: primary | all | ``. |
wakeup | boolean | true | true → agent.followup() wakes the agent and delivers; false → agent.inject() queues model-facing context only (no wake). |
notice | string | '' | Optional custom notice text; returned verbatim when non-empty, else the default. |
restartUnit | string | '' | Systemd unit to restart when smart_restart is invoked (e.g. dsh.service or dsh-deepartments-dev.service). Must be set per profile; empty → the tool fails safe with a clear error. |
toolEnabled | boolean | true | Whether the smart_restart tool is registered (available to agent sessions). |
shutdownGraceMs | number | 600000 | Grace window (ms, default 10 minutes) before shutdown within which last agent activity counts as "agent-involved" for the smart shutdown auto-notification. If the last-active session was idle beyond this window on shutdown, the pin is skipped and delivery falls back to target. |
target semantics (fallback path only — a pending notice or a usable shutdown notice overrides target for that boot):
primary— the first root agent to start (the main agent). Delivery is guarded so exactly one primary is notified.all— every root agent.- `` — an exact session id, pinned to one specific agent.
Full example patch row, restating every key with a custom notice and an explicit restartUnit:
- insert:
- id: smart-restart
name: dsh-smart-restart
config:
enabled: true
stateDir: .smart-restart
target: primary
wakeup: true
notice: "The DSH service restarted. Please check for interrupted work and report your status in one line."
restartUnit: dsh.service
toolEnabled: true
shutdownGraceMs: 600000
Single delivery channel. When
wakeupis enabled the notice is delivered viaagent.followup(); when disabled, viaagent.inject(). It is never both with the same message — a followup that queues into the inbox and a parallel inject of the same message would collide with Inbox's "already pending" validation.