Introduction

In DeepSeek Harness development, you sometimes need to restart the Desktop process to refresh the environment or reload plugins. After a restart, persistent sessions are usually disconnected. The dsh-self-restart plugin solves this problem: it allows a session to request a Desktop restart, then automatically resumes the same session after the restart and continues executing the task.

What Is This?

dsh-self-restart is a community plugin maintained by NecromanAlbert. It runs only in the Host process. It reads handoff files, resumes sessions, and sends follow-up tasks.

Core Features

  • Request a Desktop restart.
  • Resume persistent sessions.
  • Send follow-up tasks.
  • Read handoff files.

Installation and Enablement

Install it using the official command:

dsh plugin --profile desktop add github:NecromanAlbert/dsh-self-restart

Restart Desktop after installation.

Typical Usage

The plugin exposes an Agent tool. Its configuration includes three parameters:

  • mission: Required. A self-contained instruction for the next round.
  • reason: Optional. Stored in the handoff file.
  • sessionId: Optional. Defaults to currentInitiator.

Example configuration:

{
  "mission": "Reload plugin copies, then verify the notes pad still opens.",
  "reason": "reload-client"
}

Mechanism

After Desktop restarts, the plugin performs the following steps:

  1. Reads $DSH_HOME/self-restart/handoff.json (maximum age: 30 minutes).
  2. If the session is inactive, calls agents.resume.
  3. Sends a plugin notification containing the mission.
  4. Clears the file.

Applicable Scenarios and Notes

  • Host-only: The plugin runs only in the Host process and has no client UI.
  • Handoff file: Only one handoff file can exist at a time. A subsequent call overwrites the previous file.
  • Manual restart: If the Host does not support desktopActions.requestRestart, the plugin writes the handoff file and prompts the user to manually restart Desktop.
  • Scope: This is not a dsh web process killer, a sidebar restart button, or a systemd integration.

Brief Ending

This tool simplifies the post-restart workflow by handling handoff files and session resumption. It is suitable for scenarios that require resetting the environment while maintaining session continuity.

  • GitHub repository: https://github.com/NecromanAlbert/dsh-self-restart
  • Ecosystem directory: https://www.skillhub.cn/plugins/NecromanAlbert/dsh-self-restart