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¶
- Two-Step Deletion: First moves to the trash (directory relocation, no byte deletion); actual deletion occurs on the next startup.
- Trash Management: Supports restore, immediate deletion, empty all, and viewing the count of items pending deletion.
- Smart Protection: Does not delete attachment bytes (addressed sharing) and search indexes (derived data).
- Sub-session Handling: Can handle sub-agent sessions, with cascade deletion enabled via checkbox confirmation.
- 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¶
- In the sidebar, click “Move to Trash” from any session’s menu.
- In the confirmation dialog, review the directories to be moved and the number of sub-agent sessions, then check the confirmation box.
- 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.