Introduction¶
DeepSeek Harness (DSH) delegates session persistence to SessionPersistence: creating, opening, flushing, counting, and listing, but does not provide destructive operations like “erasing an entire conversation from disk”—archiving is the built-in non-destructive path. During long-term local development, relying solely on the sidebar’s built-in capabilities is often insufficient for handling accidentally created blank sessions, conversations you want to thoroughly clear after test runs, or old sessions left in “Ungrouped” after adding a directory as a workspace.
Below is an introduction to the community plugin dsh-plugin-session-delete (maintained by SereinHK, categorized as “Memory” on SkillHub). It supplements the “delete conversation” feature and batch cleanup of blank sessions on DSH 0.2.x, keeping the policy for “what can be deleted and what must be refused” within the plugin rather than embedding it into the storage layer.
What is this¶
In short: A DSH plugin for the web sidebar—single sessions can be moved to a trash bin for restoration within a retention period or immediate destruction. It also offers one-click cleanup of blank sessions that have never started a turn, and attempts to repair the ownership of workspaces and session directories upon startup.
The DSH core intentionally does not provide delete functionality; this plugin targets scenarios where “bytes need to be moved away from the sessions root.” Implementation-wise, deletion is a same-volume rename to a trash folder adjacent to the sessions root. The default retention is approximately seven days (or configurable via profile). Items can be viewed, restored, or purged immediately from the bottom of the sidebar; unhandled items are cleared after the retention period ends. Attachments, exported files, and files within the workspace are not touched by the plugin.
Core Features¶
Single Delete: Session “…” Menu¶
The plugin registers a red Delete conversation row (order ~900, danger style) to the extension point sidebar.workspaces.session.menu.item, appearing after the built-in Pin / Rename / Fork / Archive options. The confirmation dialog specifies the session title and deletion scope, executing Delete permanently only after confirmation. Upon success, the Host emits api-session/removed, and the list is refetched.
The following sessions will be refused deletion (Host returns 409 session-open): logs that still correspond to an ongoing turn and whose handle has not been closed. Simply being “open in the current window” is not sufficient grounds for refusal—switching conversations does not release the Session, otherwise, the operator would have to restart DSH.
Batch Cleanup and Trash¶
- Clean up empty conversations (
sidebar.footer.action): Scans for sessions withblank: true(never started a turn), lists the workspace path and idle duration, then confirms before deleting them one by one and summarizingdeleted / failed / skipped. Planned skips include: the currently open session, sessions where an Agent is still running, and blank sessions with activity within the last hour (to avoid accidentally deleting a “New Conversation” clicked in another window). - Trash: Lists sessions moved to trash along with their remaining retention time, supporting single restore or purge, as well as “Empty All”.
Confirmation and list UIs are presented via shell.overlay, explaining content and remaining time based on the session title (or path).
Host-side API and Startup Repair¶
The Node side registers six routes under the authenticated /api Connection, for example:
POST /api/session.delete— Move to trashPOST /api/session.unused— Provides per-Session facts the frontend cannot derive itself (whether blank, last prompt time, etc.)POST /api/session.trash/restore/purge— List (expired items are purged first), restore, destroyPOST /api/session.adopt— Attaches a Session already existing on disk back to the workspace that owns its directory (the runtime only attaches at creation time; when a directory is added as a workspace later or re-added after renaming, old Sessions are left in ungrouped)
The plugin also runs an adopt repair once at startup.
Other boundaries (documented in the materials): Invalid session IDs return 400 invalid-session-id; paths not conforming to <root>/<project>/<encoded id> return 500 unsafe-target.
Installation and Activation¶
Requires DSH 0.2.x. The menu extension point does not exist in 0.1.x; on that version, you may only see the sidebar cleanup capabilities. The README notes validation on @deepseek-ai/dsh-desktop-runtime 0.2.0-rc.2.
A window or instance reload is required after installation; the package includes a dsh.bundle.patch, and the plugin line is written automatically, so manual edits to the profile’s cordis.patch.yml are generally unnecessary. lib/ is pre-built, so no compilation occurs during installation.
When installing from GitHub, use the https URL; do not use the github:owner/repo shorthand (pnpm may normalize it to SSH, causing failure if no keys are present). Not published to npm, so do not use the registry form like dsh plugin add dsh-plugin-session-delete.
# Track the repository default branch (lockfile will pin specific commit)
dsh plugin --profile <profile> add https://github.com/SereinHK/dsh-plugin-session-delete.git
# Or install the tgz provided by the release; git is not required on the installation machine
dsh plugin --profile <profile> add https://github.com/SereinHK/dsh-plugin-session-delete/releases/download/v0.1.2/dsh-plugin-session-delete-0.1.2.tgz
You can also paste the same spec into the sidebar Plugins page. The desktop app has a built-in package manager, so the Plugins page does not rely on pnpm in the local PATH; running bare dsh plugin requires local pnpm.
To pin to a specific release tag, you can write the git ref in the profile’s package.json and reinstall, for example:
"dsh-plugin-session-delete": "git+https://github.com/SereinHK/dsh-plugin-session-delete.git#v0.1.0"
Uninstallation: Remove via the Plugins page, or:
dsh plugin --profile <profile> remove dsh-plugin-session-delete
License: MIT (see repository README badge).
Typical Usage¶
- After installing and reloading DSH, open the
...menu on the target Session row; Delete conversation should appear at the bottom. - Verify the title and deletion instructions in the dialog, then click Delete permanently; if you need to reverse the action, open the sidebar Trash within the retention window to restore it.
- To organize blank sessions that have never started a turn: Click Clean up empty conversations, view the list and items to be skipped, confirm the count, and execute; afterwards, check the
deleted / failed / skippedsummary.
Menu structure diagram (from README):
Pin / Rename / Fork / Archive
─────────────────────────────
Delete conversation ← This plugin
Use Cases and Notes¶
Who it is for: Developers who need to truly remove conversation data on their local DSH instance, batch delete blank sessions, or repair inconsistencies between workspaces and disk Session directories.
Permissions and Security: The plugin reads and writes to the sessions root and trash with the permissions of the current DSH process; you should read the source code and license before installing to ensure the behavior complies with your data strategy. Deletion moves the entire Session directory (logs of all generations) and projection-cache records, but they can still be restored via Trash within the retention period; they are irrecoverable after expiration or manual purge.
Ecosystem Note: DSH emphasizes “Everything is a plugin”; the SkillHub directory page is a community collection site, has no official affiliation with DeepSeek / High-Flyer, and is not an official app store.
Links¶
- Directory Page: https://www.skillhub.cn/plugins/SereinHK/dsh-plugin-session-delete
- Repository: https://github.com/SereinHK/dsh-plugin-session-delete
Through the steps above, you can clean up conversations and blank sessions according to your own strategy while preserving DSH’s “default non-destructive deletion” design, and perform a final confirmation or restoration within the trash window.