DeepSeek Harness (dsh) treats everything as plugins, and its Web process runs as a long-lived systemd-managed service. When a plugin needs updating or a restart occurs, a hard restart interrupts current tasks, disconnects browser connections, and loses in-memory goal state. dsh-phoenix turns the destructive “plugin update → dsh restart” operation into a recoverable loop: tasks end at safe boundaries, the browser reconnects automatically, and long-term goals continue evolving across restarts.
dsh-phoenix is a persistent plugin maintained by StvLi. It addresses three core pain points: restarting at safe boundaries, preserving page connections, and restoring goal state across restarts.
Core Capabilities¶
1. Safe Restart¶
When the plugin is activated by the cordis_run tool, dsh-phoenix does not restart immediately. It checks all active agents (including subagents) and performs the restart only when all agents are idle. To prevent indefinite waiting, a 5-minute limit is set.
The restart process is run as a separate transient unit via systemd-run --user, ensuring the restarted process terminates completely.
2. Automatic Client Reconnection¶
The plugin registers a /__dsh_health endpoint that returns a boot-based token.
It injects a zero-dependency heartbeat script into the client, which periodically polls the endpoint. Once the token changes (i.e., the backend has restarted), the page automatically refreshes. This eliminates page freezes or “stopped” states caused by backend restarts.
3. Goal Continuity Across Restarts¶
Goal state is persistent in session logs, but dsh disables active goals after each restart.
dsh-phoenix reads the persisted JSON checkpoint. If pendingResume is true, it finds the current agent’s active but disabled goal and calls goals.resume() to reactivate the goal, allowing the driver to continue the next iteration.
Usage¶
Autonomous Evolution Loop¶
Combining the capabilities above enables an autonomous evolution loop across restarts:
- Read the checkpoint
- Decide the next step
- Test or modify the plugin
- Write the checkpoint (
pendingResume: true) - Perform a safe restart
- dsh starts, and dsh-phoenix re-arms the goal
- Enter the next iteration…
Command Operations¶
Use the dsh plugin add/remove/update CLI commands to manage plugins.
Environment Requirements and Notes¶
- Node.js: Requires >= 22.
- Dependencies: Requires
@deepseek-ai/dsh-toolsand@deepseek-ai/dsh-agent-presetsas peer dependencies. - Trigger Mechanism: Responds only to the
cordis_runaction. HMR hot-reload edits by dsh itself do not trigger a restart. - License: MIT.
With checkpoints as persistent memory, goals as the driver, and re-arming as the revival point, dsh-phoenix provides dsh with complete, seamless lifecycle management capabilities.