AI Agent Hub
Back to plugins
🧩

dsh-safety-restart

admin-security Updated 2026.09.13

Run the following command in DeepSeek Harness:

dsh plugin install Dayi-Z/dsh-safety-restart

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install Dayi-Z/dsh-safety-restart in your DeepSeek Harness terminal to install this plugin; full source is available at https://github.com/Dayi-Z/dsh-safety-restart .

About this plugin

Modifying host-half code (index.js, lib/*.js) requires a full process restart to take effect, but until now the agent had no means to trigger one, leaving users to restart manually. A subtler pitfall: recycling only the renderer process does not refresh the route table, so newly added tool calls all return 404, easily misdiagnosed as a routing bug.

dsh-safety-restart turns that restart into a single tool call and enforces four safety gates before the process actually exits: a restart-loop circuit breaker (refuses if the window limit is exceeded), detection of other sessions mid-turn (avoids cutting work in progress), profile bundle table validation (refuses on any unresolved or missing bundle, including the checked:false unknown state), and availability of a reliable relaunch mechanism (never degrades to killing the process). If any gate fails, the plugin refuses with a specific reason rather than forcing through. After restart, it writes a resume marker and delivers a continuation prompt back to the original session so the agent picks up seamlessly where it left off.

Built for Harness developers who frequently modify host-half code and need the agent to reload its environment autonomously within automated workflows. Desktop (Electron app.relaunch) and web/CLI (detached helper with health check) each have a tailored restart path, and every restart or refusal is appended to a JSONL audit log for post-mortem analysis.

Use Cases

  • Agent auto-restarts the host process after modifying host-half code
  • Automated workflows reload the environment without manual user action
  • Pre-restart safety gates prevent restart storms and mid-turn session conflicts

Best For

  • Harness developers who frequently modify host-half code
  • Engineers building automated agent workflows
  • Security admins who need restart audit logs and circuit-breaker tracking