The default session management in DeepSeek Harness (DSH) only supports renaming, forking, and archiving operations. Archiving only hides the session; the data remains on disk. Long-term use can cause storage space to bloat. The dsh-session-delete plugin adds a “Delete Session” option to the session row menu, supports permanently removing log files on disk, and includes safeguards to prevent accidental deletion of running sessions.

Core Features

This plugin adds a “Delete Session” entry to the DSH session row context menu, alongside Rename, Fork, and Archive.

  1. Permanent Deletion: Permanently removes the session log directory from disk.
  2. Runtime Protection: Prevents deletion of running or currently open sessions (frontend disablement + host-side double check).
  3. Path Safety: Strictly validates that the directory name equals the session ID to prevent path escape.
  4. Request Validation: Accepts only same-origin POST requests.
  5. Action Confirmation: Requires a two-step confirmation before deletion.
  6. Automatic Archiving: After deletion, the session is automatically archived and hidden immediately in the sidebar.

Installation and Enablement

  1. Install the plugin:
    dsh plugin --profile web add github:Yicijiuhaobala/dsh-session-delete
  1. Enable the plugin: Add "dsh-session-delete" to the dsh.profile.bundles array in ~/.dsh/profiles/web/package.json, then restart dsh web.
  2. Local development: If working locally, synchronize client/client.js and lib/index.js to ~/.dsh/profiles/web/node_modules/dsh-session-delete/, or rerun pnpm install to trigger hot updates.

Typical Usage

  • Standard Operation: Hover the mouse over any session row, click the ⋯ (three dots) in the lower-right corner, and select “Delete Session”.
  • Deleting Archived Sessions: To delete an archived session, remove its ID from archivedSessionIds in ~/.dsh/storages/workspace., or directly delete the directory ~/.dsh/sessions/<workspace-dir>/<session-id>/.

Technical Notes

Because shared UI primitives in DSH are frozen with Object.freeze, component-level patches would silently fail; this plugin is therefore implemented via DOM-level injection. The plugin is released under the MIT license.