dsh-plugin-delete-chat: Permanently delete a session in DSH

Introduction

DeepSeek Harness session data is persistently stored locally by default (<DSH_HOME>/sessions, where DSH_HOME defaults to ~/.dsh). As debugging progresses, dozens of sessions often accumulate within the same project: some are partially failed tasks, and others are trial records no longer needed. The built-in Archive merely hides the entry, but the data remains on disk and can still be found in the sidebar. When a project needs storage cleanup or a session involves sensitive content requiring total disappearance, you have to locate and manually delete directories in the sessions/ folder yourself, and also clean up projection-cache records associated with them—a cumbersome process prone to missing derived data.

The eyadagharire/dsh-plugin-delete-chat introduced below is a plugin designed to address this pain point: it adds a line Delete chat to the ‘…’ menu of every session, complete with a confirmation dialog. Upon confirmation, it permanently deletes that session and its storage data on the device. The maintainer is EYADAGHARIRE, categorized under admin-security. The directory page and GitHub currently have 0 stars; it is an older but relatively niche utility plugin.

What is this

In one sentence: It is the official plugin that injects the ‘Delete chat’ action into the session row menu of the DeepSeek Harness Web UI. The deletion action is available only in the UI; agents cannot invoke it.

It solves two specific problems:

  1. Deletion is permanent, not archive-style hiding;
  2. Before deleting a session, active work inside it must be stopped to avoid data still being written after deletion.

The plugin is published on npm (dsh-plugin-delete-chat), source code is on GitHub, license is MIT, and the repository includes bilingual locale files (locale/en.json, locale/zh.json). The UI copy follows the application’s language settings.

Core Features

Only capabilities explicitly documented in the README are described.

  1. Menu Location and Appearance. It inserts a line Delete chat after the built-in menu items (Pin, Rename, Fork, Archive, Copy Session ID). The style is identical to the built-in Delete workspace line: error-red label, same IconTrashOutlineRegular trash can icon (same path, 16x16 viewBox, 1px stroke), and a dangerous hue fill on hover.

  2. Confirmation Dialog. It uses the host’s own Modal style, clearly stating “Irreversible”, offering Cancel/Delete buttons, and supporting Escape to close and focus trap.

  3. Stop work first, then delete data. It stops ongoing work within the session using the same activity seam as the built-in Archive process: in-progress turns, subagents, background jobs, and scheduled reminders.

  4. Deletion Scope. Upon deletion, the following are permanently removed:

  • The session log directory under <DSH_HOME>/sessions/--<project>--/<session-id>/;
  • The projection-cache derived records corresponding to that session.
  1. Immediate disappearance from sidebar. After deletion completes, it publishes an api-session/removed event, causing the row to be immediately removed from the sidebar.

  2. Auto-switch to a new session if the current one is deleted. It does not leave the main view pointing to a deleted session.

  3. Permission Boundaries. Only users can trigger it from the UI; agents have no tools to delete sessions; subagent sessions are rejected from deletion (they are removed along with the parent session).

  4. Workspace files are not affected. Workspace files within the workspace where the session resides are never touched.

Installation and Activation

Before installing, check the environment requirements: DeepSeek Harness 0.2.1-rc.5 or higher (written in the engines.dsh field).

Method 1: Install in Harness UI (most direct).

Open Plugins → Add plugin, enter the package name and confirm:

dsh-plugin-delete-chat

The host side activates immediately, and the Delete chat line appears in the connected page.

Method 2: Install from the Plugin Market.

In Plugins → Discover → Add index source, add the following index source:

https://eyadagharire.github.io/dsh-plugin-delete-chat/index.json

Then install the Delete chat card. Other plugin market index sources listing this package can also be used.

Method 3: Install from source.

Point the plugin manager to the package directory—the plugin manager’s install_bundle action accepts the absolute path of that directory.

Typical Usage

The README does not provide command-line examples; all operation entry points are in the UI:

  1. Open the ‘…’ menu for a session in the sidebar;
  2. Find the red Delete chat line after the built-in items, and click it;
  3. In the host-style confirmation dialog, clearly see the “Irreversible” warning;
  4. Click Delete, or press Escape / Cancel to abort.

After confirmation, the plugin performs three things in sequence: stop the work currently running in this session (turns, subagents, background jobs, scheduled reminders), delete the session’s log directory and projection-cache records, and then notify the UI to remove the line from the sidebar. If the session deleted is the one currently open in the main view, the interface automatically jumps to a new session.

If a subagent session is deleted, the operation is rejected—such sessions are removed along with the parent session and do not require individual deletion.

Uninstallation method: Disable or remove the bundle in Settings → Plugins. Deleted sessions remain deleted and will not be restored due to plugin uninstallation.

Applicable Scenarios and Notes

Suitable for the following scenarios:

  • The local sessions/ directory is filled with a large number of sessions generated by long-term debugging, requiring real space release instead of archiving;
  • A session carries sensitive content and requires no residual traces left on the device;
  • When developing your own session management plugin and needing to reference the complete chain of “stop work first, then delete data, then notify UI”.

Notes:

  1. Deletion is irreversible; this is a design goal, not a defect. The prompt in the confirmation dialog conveys this meaning; please confirm you have selected the correct session before clicking Delete.
  2. The plugin runs with the permissions of the current dsh process. It directly reads and writes <DSH_HOME>/sessions. It is recommended to review the source code and MIT license before enabling to ensure the source is trustworthy.
  3. Do not confuse it with “Delete workspace”. While their visual styles are deliberately made consistent, this plugin only deletes session storage and does not touch files in the workspace; to clear a workspace, use the built-in action.
  4. The Host side depends on three services: connection, webServer, and sessionPersistence, while the Client side registers to sidebar.workspaces.session.menu.item and shell.overlay. It cannot load if the host version is below 0.2.1-rc.5.
  5. Subagent sessions and agent tool calls are both excluded. If you want to add deletion logic to an automation script, this plugin does not support it; the behavior is a clear rejection.

Summary

The value of this plugin lies in bringing a manual operations task—originally requiring directory digging—into the session menu: deletion scope is clear (session logs + projection-cache, no touching workspace files), order is clear (delete after stopping work), and permissions are clear (User only, UI only). For DSH’s philosophy of “Everything is a plugin”, it also demonstrates how to extend a session lifecycle operation without modifying the host, using standard slots and activity seams. The community directory page is at https://www.skillhub.cn/plugins/EYADAGHARIRE/dsh-plugin-delete-chat, and the source code and installation instructions are at https://github.com/EYADAGHARIRE/dsh-plugin-delete-chat.

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

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

Xiaoye