dsh-session-purge: Completely Purge DeepSeek Harness Sessions

Introduction

The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin”. By default, the DSH client provides only an “archive” feature. Archiving hides a session from the main view, but does not delete its log files from disk (such as session.vN.jsonl.zstd) or its projection cache. The official documentation also explicitly labels this as a “no session deletion” limitation in dsh-client-ui-workspace.

The dsh-session-purge plugin fills this gap. It allows users to completely delete session data, free up disk space, and clean up persisted state.

Core Features

The plugin provides two deletion paths, covering single-session and batch scenarios:

  • Permanently delete a single session: An entry point is available in the “…” menu on the right side of each session row. This option is visible whether the session is archived or not.
  • Delete all archived sessions in one click: After switching the filter in the top menu of the sidebar to “Show archived only”, a batch action button appears in the bottom action area. This design ensures the deletion scope matches the current view and prevents mistakenly deleting non-archived sessions.

The deletion operation performs the following steps in sequence to ensure state consistency:
1. Workspace bookkeeping: Removes the session ID from the sessionIds of the owning Workspace.
2. Archive marking: Removes it from the global archived set archivedSessionIds.
3. Disk logs: Deletes the session log directory and the corresponding session.vN.jsonl.zstd file.
4. Projection cache: Deletes the cache files in session_projcache and cleans up other persisted state.

Installation

Install it using the official command:

dsh plugin --profile desktop add @lxchapu/dsh-session-purge

Restart the application after installation to apply the changes.

Typical Usage

  1. Delete a single session: Find the target session in the session list, click “…” on the right, and select “Permanently delete”. The system shows a confirmation prompt, warning that the data will be permanently deleted from disk and cannot be undone.
  2. Batch delete: Click the filter button at the top of the sidebar and select “Show archived only”. A batch action button then appears at the bottom of the list; click it to delete all sessions in the current list.

Notes

  • Running session deletion is rejected: If the session status is running (including waiting for approval, blocked by tools, etc.), the deletion request is rejected. The system prompts the user to finish the current turn before deleting.
  • The operation is irreversible: There is no recycle bin mechanism after deletion; disk logs and caches are physically removed.
  • Dependency: The plugin depends on dsh.client.inject, ensuring that the host injects the required session and workspace controller interfaces.
  • Version update: Version 0.1.2 fixed an issue where a single session could not be deleted. It is recommended to use the latest version.

Summary

dsh-session-purge is an effective tool for resolving accumulated DSH session data. Without changing DSH’s official architecture, it provides a safe session cleanup capability.

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

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

Xiaoye