dsh-session-cleanup: Archived Session Cleanup Plugin for DeepSeek Harness

Introduction

DeepSeek Harness (DSH) supports session archiving functionality for the long-term management of project sessions. The original archiving page only provided an “Unarchive” operation, which failed to clean up the actual log files on the disk. As usage time increases and archived sessions accumulate, disk usage continues to rise. This plugin adds deletion capability to the Settings -> “Archived Sessions” page, supporting the removal of actual session records.

Core Features

This plugin adds session cleanup capabilities to the DSH client, specifically including:
* Single Delete: Adds a separate delete button for each session in the Settings -> “Archived Sessions” page.
* Delete All: Adds a “Delete All” function at the top of the list.
* Physical Cleanup: The delete operation removes session records from the disk, rather than just removing them from the list.
* Residual Handling: Displays entries where the “session record is no longer on the disk”, retaining the archived status for retry purposes.
* Failure Retry: If deletion fails, the archived status is maintained, and the item will not disappear from the archived list.

Installation & Activation

Installing the plugin requires restarting the dsh web service to mount the routes.

dsh plugin --profile web add <本仓库>/plugins/dsh-session-cleanup/0.2.1-rc.2/dsh-session-cleanup-0.1.3.tgz
dsh plugin --profile web install

Typical Usage

  • Unarchive: Click the right side of each row to return the session to the sidebar; logs are retained.
  • Delete: Click the delete button on the right side of each row to delete the session and its logs (requires secondary confirmation).
  • Delete All: Click the Delete All button above the list to delete all archived sessions (requires secondary confirmation).

Security Boundaries

  • Interface Scope: The deletion interface listens on POST /plugins/dsh-session-cleanup/delete.
  • Access Restrictions: Limited to localhost loopback access (127.0.0.1 / ::1); requests from other sources will return 403.
  • Path Constraints: The target path must fall within <DSH_HOME>/sessions.
  • Exclusions: Does not delete session_projcache/sessions/<id>.
  • Irreversibility: The deletion operation is irreversible; session logs will be removed from the disk.

Conclusion

This plugin complements DSH’s session lifecycle management through host-side capabilities, making it suitable for users who need to regularly clean up archived logs.

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

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

Xiaoye