dsh-session-reaper: Recoverable Session Deletion and Disk Reclamation

Preface

DeepSeek Harness (DSH) does not delete any sessions by default. The persistence layer provides no deletion API, and even archived sessions continue to occupy disk space. Over prolonged use, session logs and attachments accumulate continuously, consuming significant storage.

dsh-session-reaper fills the gap in DSH’s session management by transforming the delete operation into a move-to-trash workflow. It supports restoration and permanent purging, and reclaims image attachments that are no longer referenced.

Plugin Overview

dsh-session-reaper is a DSH plugin provided by maintainer hello2fun. It adds a left sidebar panel and a per-session menu entry to DSH, enabling recoverable session deletion and disk reclamation.

Core capabilities include:
- Converting the delete operation into a move-to-trash action instead of permanent removal
- Reclaiming image attachments that are no longer referenced
- Providing a session list, multi-select deletion, trash viewing, and permanent purge

Installation & Activation

Install from DSH’s Plugins page: navigate to “Add plugin” and enter dsh-session-reaper.

Alternatively, install via the command line:

dsh plugin --profile <name> add dsh-session-reaper

After installation, restart DSH. A “Sessions” entry will appear in the left sidebar, and a “Delete session…” option will appear in the menu of each session row.

Data Locations

Type Path
Session logs in trash $DSH_HOME/deleted-sessions/<batch>/<id>/session + meta.json
Image objects $DSH_HOME/attachments/v1/objects/<sha256-prefix>/<sha256>
Active session logs $DSH_HOME/sessions/<project>/<id>/

When a session is deleted, its log directory is moved to the trash. Image objects are only removed when no other active session references them.

Typical Usage

  1. In the left “Sessions” panel, you can search and filter sessions, select multiple sessions, and perform batch deletion.
  2. Upon deletion, sessions are moved to the trash with full logs and metadata preserved.
  3. In the “Sessions” panel, switch to the “Trash” view to browse deleted sessions.
  4. From the trash, you can restore a session, moving its log directory back to $DSH_HOME/sessions/ and re-mounting it to the workspace.
  5. Click “Purge” in the trash to permanently delete; the directory and referenced images will be cleaned up together.

Notes

  • Session logs continue to occupy disk space until they are permanently purged.
  • By default, deletion includes the “Also delete the referenced images” option checked. If the session is subsequently restored, its images cannot be recovered.
  • Non-image file attachments (v1/file-objects) are not collected.
  • Deleting a session that is currently being written to by another process may fail; the error message will indicate the session ID.
  • No configuration is currently supported; the 60-second recent-object protection window and the trash location are fixed values.

Use Cases

Ideal for DSH users who need long-term retention of session records and want the ability to roll back deleted sessions. Before use, review the plugin source code and license to ensure compliance with local usage policies.

Summary

dsh-session-reaper transforms the delete operation from “irreversible” to “recoverable” via a trash mechanism, and reclaims unreferenced image attachments, alleviating disk usage issues caused by DSH session accumulation. For further details, see the plugin directory page and the GitHub repository.

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

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

Xiaoye