dsh-plugin-session-purge: Implementing Two-Step Secure Deletion via Recycle Bin Mechanism

Preface

The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” However, the README of the native dsh-client-ui-workspace explicitly states “sessions cannot be deleted—they can be archived but never removed.” The dsh-plugin-session-purge plugin fills this gap by introducing a trash mechanism, providing genuine deletion capability.

Core Features

  1. Two-Step Deletion: First moves to the trash (directory relocation, no byte deletion); actual deletion occurs on the next startup.
  2. Trash Management: Supports restore, immediate deletion, empty all, and viewing the count of items pending deletion.
  3. Smart Protection: Does not delete attachment bytes (addressed sharing) and search indexes (derived data).
  4. Sub-session Handling: Can handle sub-agent sessions, with cascade deletion enabled via checkbox confirmation.
  5. API Support: Host-side provides precise routing APIs (plan, move, list, restore, empty).

Installation and Activation

Install via command line:

dsh plugin --profile web add github:OliYogSothoth/dsh-plugin-session-purge

Or add via the plugin page in the UI by pasting the GitHub repository URL.

Usage

  1. In the sidebar, click “Move to Trash” from any session’s menu.
  2. In the confirmation dialog, review the directories to be moved and the number of sub-agent sessions, then check the confirmation box.
  3. In the “Trash” entry at the bottom of the sidebar, click “Restore” or “Delete Now.”

Implementation and Security Details

  • Two-Stage Deletion: Clicking the menu only moves the directory; actual deletion occurs when DSH next starts. During this phase, workspace registrations, projection caches, and session directories are cleaned up.
  • Data Protection: The plugin does not delete attachment bytes (to avoid breaking addressed sharing) and search indexes (derived data).
  • Process Safety: If a session is alive within the process, the plugin first stops its work, evicts memory entries, and then performs file operations.
  • Permission Restriction: A caller cannot delete a session when declaring its own session identity.

Uninstallation and Cleanup

Before uninstalling, you must click “Empty Trash” in the trash panel. After uninstallation, the trash directory remains under <DSH_HOME>\session-purge-trash\ and requires manual handling: deleting the directory means actual deletion; moving it back means restoration.

Conclusion

This plugin resolves the pain point of DSH’s inability to natively delete sessions through a trash mechanism, making it suitable for users who need to thoroughly clean up historical sessions and free up storage space.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye