dsh-session-trash: Session Deletion and Recycle Bin Support for DSH

Introduction

The DSH Web GUI sidebar session menu only offers four actions: Pin / Rename / Fork / Archive. Archiving merely moves a session out of the default view—the files remain on disk, the archive list keeps growing, and sensitive content can never be truly removed. To clean up these sessions, you’re forced to operate manually in the filesystem, which is error-prone and irreversible.

dsh-session-trash is a client-side plugin that adds session deletion capabilities to DSH without modifying its source code: single-step confirmation, batch deletion, a recoverable trash bin, and a cross-workspace session overview.

What It Is

dsh-session-trash is a client-side plugin for DSH (DeepSeek Harness) Web GUI that provides session deletion and trash management. Maintained by chuilian, the plugin has zero runtime dependencies and no build step—the lib/ directory serves as both source and the installed runtime artifact.

It solves the following problem: DSH natively only supports archiving sessions, not deleting them. This plugin adds session deletion and trash management, making session cleanup and recovery controllable.

Core Features

Session Deletion

A new “Delete Session” option appears in the “…” menu of each sidebar session row, positioned after Archive. Deletion behavior is controlled by the plugin, and the result is reported via a dismissible notification bar.

Only two situations require an explicit confirmation stop:

  • The session is still actively running: the button reads “Force Delete”, and the dialog explains that the running job will be stopped first and will not automatically resume.
  • Scheduled tasks are pointing to this session: the button reads “Delete”, and the dialog notes that those scheduled tasks will be deleted along with the session and will not automatically restore.

In all other cases—including sessions that have finished chatting but still linger in DSH’s memory—a single click deletes immediately. The deletion always completes, and the result notification bar will state “N scheduled task(s) targeting these session(s) were also deleted.”

Batch Deletion

Click “Batch Delete Sessions…” in any session’s “…” menu. The dialog lists all deletable sessions. Nothing is pre-selected by default; you can filter by title or session ID via the search box, and select / deselect all. The list is grouped by workspace, with each group showing the directory name, full path, and session count—each group is collapsible.

Already-deleted and already-archived sessions do not appear in the list. Sessions that cannot be deleted will show a reason (e.g., “directory cannot be confirmed”), but any session can still be checked; the host will report results item by item.

The per-request limit defaults to 100 (configurable); the plugin automatically splits requests into batches when the limit is exceeded.

Trash Bin

Deletion is a “move to trash” operation, not a wipe—entries can be restored at any time. An independent Trash panel is available in the sidebar’s “More” menu.

The top of the Trash panel shows the entry count and disk space used. Each entry displays the title, deletion time, size, and original workspace path. Restore options include clicking the restore icon on a single entry, or checking multiple entries and clicking “Restore Selected”. After restoration, the session returns to its original absolute path from before deletion, content is byte-for-byte identical, and it reappears in the sidebar and session list.

If the session was in “Archived” or “Pinned” state before deletion, both states are restored upon recovery.

During restoration, the session is first re-attached to the DSH runtime (by calling the host’s sessionController.resolveAgent). You can pick up the conversation immediately after restoration—no restart required.

Permanent Deletion

The Trash panel supports checking entries and clicking “Permanently Delete”, or clicking “Empty Trash”. A confirmation dialog shows the number of entries and disk space to be permanently removed, and explicitly states that this action is irreversible. Upon confirmation, the session files are wiped directly.

The host requires acknowledge: true; otherwise the request is rejected (HTTP 428).

The retention period (default 30 days) is only used to flag entries as “past retention” in the panel with a count. The plugin never automatically deletes expired entries.

Operation Log

An expandable “Operation Log” section at the bottom of the Trash panel shows the most recent 50 records. The full log is stored at ~/.dsh/session-trash/logs/trash-<YYYY-MM-DD>.ndjson, with one JSON object per line, containing timestamp, operation type (trash / restore / purge / delete), result (ok / refused / failed), session ID, trash entry ID, reason code, and operator label.

Session Overview

An additional “In Progress” button (list icon + text) appears to the right of the sidebar session header. Clicking it opens a cross-workspace session list, grouped by workspace, defaulting to the last 2 hours. Clicking any entry jumps directly to that session to continue the conversation. The list is a pop-up overlay and does not occupy the main content area.

The list is a read-only entry point. The only action it performs is switching sessions—it does not delete, archive, or rename anything.

Installation & Enablement

Prerequisites

  • DSH >= 0.2.0-rc.1
  • Node.js >= 22.19 (the DSH bundled runtime satisfies this)
  • No network required: the plugin has zero runtime dependencies; the host side uses only Node built-in modules; the browser side uses only DSH platform-provided modules

Install from GitHub

dsh plugin --profile <profile> add github:chuilian/dsh-session-trash

You can also enter the same source in the Web GUI plugin manager. After installation, simply refresh the page.

Install from Source

Clone the repository locally, then point the profile directly at that directory:

git clone https://github.com/chuilian/dsh-session-trash.git
dsh plugin --profile <profile> add link:/absolute/path/to/dsh-session-trash

The link: registration is spread across four locations. Missing or misconfiguring any one of them will cause the entry to be overwritten on the next pnpm install:

Location Registration Content
~/.dsh/profiles/<profile>/package.json → dependencies "dsh-session-trash": "link:/absolute/path/to/dsh-session-trash"
~/.dsh/profiles/<profile>/pnpm-lock.yaml → importers section specifier: link:/absolute/path/to/dsh-session-trash + version: link:<path relative to profile>
~/.dsh/profiles/<profile>/node_modules/dsh-session-trash A relative symlink pointing to the source directory
~/.dsh/profiles/<profile>/package.json → dsh.profile.bundles Package name dsh-session-trash (bare package name, no path)

After making changes, verify each entry against the table above, then restart DSH.

Post-Install Verification

  1. Refresh the page.
  2. A “Trash” entry should appear in the sidebar’s “More” menu.
  3. The “…” menu on any session row should show “Delete Session” and “Batch Delete Sessions…”.
  4. After opening any session, an “In Progress” button should appear in the icon row on the right side of the header; clicking it pops up the cross-workspace session overview below.

Uninstall

dsh plugin remove dsh-session-trash

Uninstallation does not delete trash data. To clean up completely:

rm -rf ~/.dsh/session-trash

Typical Usage

Delete a Single Session

  1. In the sidebar, find the target session, hover over the row, and click the “…” at the end.
  2. Click “Delete Session” at the bottom of the menu.
  3. If the session is still running or has scheduled tasks pointing to it, a dialog will show the session status and reason. Click the primary button to confirm deletion.
  4. In all other cases, one click deletes immediately. A notification in the bottom-right corner reads “Session deleted” and can be undone.

Restore from Trash

  1. Open the sidebar’s “More” menu and click “Trash”.
  2. Click the restore icon on a single entry, or check multiple entries and click “Restore Selected”.
  3. The session returns to its original absolute path from before deletion and reappears in the sidebar.

Permanent Deletion

  1. Open the “Trash” panel.
  2. Check the entries to be permanently removed, then click “Permanently Delete” or “Empty Trash”.
  3. After confirmation, the session files are wiped directly.

Use Cases & Notes

Ideal for scenarios where you need to clean up DSH sessions, manage session lifecycle, or recover content from deleted sessions.

The plugin runs with the permissions of the current dsh process. Review the source code and license before installing.

Conclusion

dsh-session-trash adds session deletion and trash bin capabilities to DSH, making session management more controllable. Full documentation and source code are available at:

  • GitHub: https://github.com/chuilian/dsh-session-trash
  • Plugin directory page: https://www.skillhub.cn/plugins/chuilian/dsh-session-trash
羽毛球分组比赛记分
小程序二维码

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

Xiaoye