dsh-session-delete-plugin: Adds permanent deletion to DSH sidebar session menu

Preface

DeepSeek Harness (DSH) is closer to “archiving” by default in session management: it records the session id into a persistent hidden set, while the logs and cache on disk are retained. For scenarios that require genuinely freeing up space, or that want a session to disappear from both the list and the disk, the built-in capabilities alone are not enough. Below we introduce the community plugin dsh-session-delete-plugin (maintainer: Theworld7, category: client). It adds Delete session to the ... menu on the sidebar session row, and after confirmation removes that session and related references from disk.

What is this

dsh-session-delete-plugin is a DSH plugin (package name dsh-session-delete-plugin, current version 1.0.0, MIT license). In one sentence: it adds a permanent “Delete session” action to the DeepSeek Harness session sidebar context menu and deletes that session from disk.

Comparison with the built-in archive (from the project README): archive only appends the id to a durable hidden-set, leaving the bytes on disk; this plugin deletes the session log directory and cached projections, and removes the corresponding id from the archived/pinned registry entries.

Core features

User-side operation

Right-click a session row in the sidebar (or open that row’s ... menu) → select Delete session → confirm → the session is cleaned up from both the UI and the disk.

Actual deletion targets

Target Path or behavior
Session log directory <DSH_HOME>/sessions/<projectKey>/<sessionId>/
Cached projection <DSH_HOME>/storages/session_projcache/sessions/<sessionId>.json
Registry sets Remove the id from archivedSessionIds, pinnedSessionIds

The plugin also stops active writes on the session via Harness mechanisms before deletion, and notifies already-open pages through the api-session/removed event, avoiding the situation of “deleted but the sidebar still shows a row” until the next refresh.

Code structure (for review)

src/index.js      Host side: delete-session command and safety policy
src/eraser.js     Carries out deletion against the disk layout
client/client.js  Client side: menu item and confirmation dialog
tests/            Behavior checks against a synthetic Harness home
cordis.patch.yml  Bundler layer and this plugin's configuration

The Host side does not depend on any @deepseek-ai/* packages; it interacts with the Harness via slots, command registration, declared events, and the disk layout.

Installation and activation

Installation commands follow the GitHub README. Node.js >=20 is required; the README declares compatibility with Harness 0.2.0-rc.2 and 0.2.1-rc.2 as compatible; other releases are not declared as verified.

Method 1: Profile package management

First obtain the plugin directory (the README example clones it locally), then mount it onto the specified profile:

git clone git@github.com:Theworld7/dsh-session-delete-plugin.git
dsh plugin --profile <profile> add <path-to-the-clone>

After installation the profile records the package and writes it to dsh.profile.bundles; afterwards a plain dsh web loads it, with no additional --patch needed. The Host side is activated via HMR, and the browser side registers to the sidebar slot after the page module graph is updated.

Method 2: Install inside an Agent session

In an agent session, use plugin_manager with action: install_bundle, pointing target to the plugin directory.

Uninstall

dsh plugin --profile <profile> remove dsh-session-delete-plugin

dsh plugin passes the arguments verbatim to the profile’s package manager. Deleted sessions are not restored; other contents under the profile are unaffected.

Typical usage and configuration

Default behavior

  • blockActive defaults to true: refuse to delete a session that is still open in the current Harness.
  • stopActivity defaults to true: stop the session’s work via workspace/session-stop before deletion.
  • cleanWorkspaceRegistry, cleanProjectionCache default to true: clean up the registry and the projection cache.

Overriding configuration via patch

The configuration items live in the plugin’s Config, and can be overridden via the profile’s cordis.patch.yml or --patch for the row with id session-delete. Note: a patch replaces the entire config object, so you must write out any keys you still want to keep:

- id: session-delete
  name: 'dsh-session-delete-plugin'
  config:
    sessionsRoot: ''
    storagesRoot: ''
    blockActive: true
    stopActivity: true
    cleanWorkspaceRegistry: true
    cleanProjectionCache: false   # only delete logs, keep projection
key default meaning
sessionsRoot '' Session log root; empty derives it from DSH_HOME or ~/.dsh
storagesRoot '' Storage root holding projection cache; empty behaves as above
blockActive true Whether to forbid deleting the currently open session
stopActivity true Whether to stop session activity first
cleanWorkspaceRegistry true Whether to remove the id from the archived/pinned sets
cleanProjectionCache true Whether to delete the projection cache file

Hot-plugging

In a running page, use plugin_manager’s set_plugin to set include:session-delete to false to remove the sidebar menu item and the Host command; set it back to true to restore. If client/client.js was modified, you must refresh the browser before the new client code takes effect; enable/disable and configuration-only changes take effect immediately.

Applicable scenarios and caveats

Who it is for: Developers or teams who have long used multiple sessions in DSH and need to genuinely delete on-disk data rather than merely archive; users willing to read the source code and permission descriptions before installing.

Permissions and risks: The plugin declares and uses the files capability—deleting directories and rewriting registry.json within <DSH_HOME>/sessions and <DSH_HOME>/storages; it does not make network requests, execute shell commands, or read credentials such as tokens (it only reads the environment variable DSH_HOME as a directory path). Deletion is unrecoverable; before installing you should review the GitHub repository source and the MIT license yourself. The plugin runs with the current dsh process’s permissions; like any DSH plugin, the trust boundary depends on your review of the maintainer and the code.

Ecosystem note: The DSH community plugin directory (such as entries on SkillHub) is an independent site, with no official affiliation to DeepSeek / High-Flyer; installation sources follow the repository README and directory page descriptions.

Conclusion

dsh-session-delete-plugin fills in the “permanently delete a session” path that Harness lacks by default: after menu confirmation it cleans up the logs, projections, and registry references, and notifies the frontend list to update. When needed, you can view the entry summary on the community directory page, and read the full installation, compatibility, and permission descriptions on GitHub.

  • Directory page: https://www.skillhub.cn/plugins/Theworld7/dsh-session-delete-plugin
  • GitHub: https://github.com/Theworld7/dsh-session-delete-plugin
羽毛球分组比赛记分
小程序二维码

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

Xiaoye