Introduction¶
When managing sessions in the DeepSeek Harness (DSH) Web GUI, the official sidebar menu provides operations such as pinning, renaming, forking, and archiving. Archiving hides the session from the main list, but the persistent directory and projection cache remain on disk. If you wish to completely remove a session’s records and full history after confirmation, rather than retaining a recoverable archived copy long-term, additional capabilities are required. The following introduces the community plugin dsh-session-delete (npm package name dsh-session-remove): it adds a “Delete Session” option to the sidebar session menu. Upon confirmation, the host route physically deletes the relevant files and synchronizes the registry and the interface.
What is this¶
dsh-session-delete is a cordis bundle plugin for DSH, maintained by rhl88. It is categorized as a client-side capability in the SkillHub Plugin Directory (actually comprising both the host index.js and the Web client client.js). It does not alter the DSH core; instead, it appends a destructive operation to the existing sidebar session menu, filling the gap where sessions could previously only be archived, not permanently deleted.
Core Features¶
Interface and Interaction¶
The client registers a menu item on sidebar.workspaces.session.menu.item (order 500, with a divider and danger styling), placed after Pin, Rename, Fork, and Archive. Clicking it triggers a confirmation dialog. Upon confirmation, it first calls archiveSession (stopping activity and releasing the client’s reference to the current session), and then sends a deletion request to the host. If it fails, the dialog displays the information returned by the host; if archiving succeeded but deletion failed, the session remains archived and can be restored via “Unarchive.”
Deletion Scope (v1)¶
In a successful flow, the host route POST /session-delete/delete will:
- Delete the JSONL backend session directory:
~/.dsh/sessions/<project_directory>/<session_id>/(including generation formats, compression variants, and lease files). - Delete the projection cache:
~/.dsh/storages/session_projcache/sessions/<session_id>.json. - Detach the ID from workspace accounting, remove it from pinned and archived sets, and broadcast
api-session/removed; connected browser sidebars reconcile immediately.
Items not deleted in v1: Content-addressed attachment bytes (shared across sessions), sub-agent session logs, and full-text search index rows (the next search will reconcile and remove deleted sessions).
Host-side Process and Security Design¶
Before deletion, the plugin resolves the session (active session or persistent stat); unknown IDs return 404. It uses workspaceRegistry.archiveSession to stop running turns, tasks, and sub-agents; it waits within a default 20-second timeout for the session to leave the active set and close persistent write handles (on Windows, directories cannot be deleted if handles are not released). Timeouts return 409 session-busy; files are left untouched, and the operation can be retried later. A containment check is performed before directory deletion, and there are limited retries for transient locks.
Registry-related calls are all timeout-bounded and non-fatal upon failure: file deletion may still succeed even if the workspace operation queue is stuck, and the response will use degraded to describe incomplete steps. If an active session does not release handles, a 409 is returned.
Dependencies and Compatibility¶
package.json declares no npm dependencies or dsh peer ranges; the host uses only Node built-in modules, while the client depends on DSH baseline browser modules (react, @deepseek-ai/dsh-client-store, @deepseek-ai/dsh-client-ui-primitives). The current version in the materials is 1.1.0, licensed under MIT.
Installation and Enablement¶
Choose one of the following installation methods (commands from the repository README):
# Install from GitHub (Recommended)
dsh plugin add github:rhl88/dsh-session-delete
# From a local directory or pre-built tarball
dsh plugin add D:\path\to\dsh-session-delete
dsh plugin add D:\path\to\local-dsh-session-delete-1.0.0.tgz
When installing manually in the profile directory, you need to add the bundle name dsh-session-remove to dsh.profile.bundles (alongside @deepseek-ai/dsh-base, @deepseek-ai/dsh-web-app, etc.), for example:
cd C:\Users\Administrator\.dsh\profiles\desktop
pnpm add github:rhl88/dsh-session-delete
dsh plugin add and plugin page installation will enable the bundle by default; manual pnpm add requires you to modify the bundles list yourself.
After installation, restart DeepSeek Harness and refresh the GUI page. Host-half changes do not hot-reload under the desktop composition (HMR root: []); restarting the application is required after modifying host code or switching bundles.
Install only one copy: The row ID session-delete and browser slot ID are fixed; enabling two instances of the same installation simultaneously will cause conflicts.
Typical Usage¶
- Open the target workspace in the DSH Web interface and locate the session to be cleared in the sidebar.
- Open the session’s menu and select “Delete Session” (the danger-colored item) after the Archive item.
- Confirm again in the dialog; if currently in that session, it will be archived and activity stopped first, followed by permanent deletion.
- Upon success, the sidebar row disappears; if a 409 is received, wait for the session to become fully idle and retry.
To troubleshoot stuck issues, you can check session-delete.debug.log (host step-by-step logs) and session-delete.client.log (written via POST /session-delete/trace) in the same directory as the deployed index.js. Self-test commands included in the package: node test/paths.test.js, node test/module-load.test.js, node test/delete-flow.test.js.
Use Cases and Notes¶
Suitable for: Development scenarios requiring compliance or a habit of “clean deletion” of session directories and projection caches, rather than just hiding them via archiving; cleaning up experimental sessions on local or self-managed DSH instances.
Important Notes:
- The plugin reads and writes paths under
~/.dshwith the permissions of the current DSH process; please read the GitHub Source Code and the MIT license before installation to ensure you accept the permanent deletion behavior. - Deletions cannot be recovered via the plugin itself; v1 does not clean up shared attachments or sub-agent logs, so related content may remain on disk.
- SkillHub and similar sites are community directories and have no official affiliation with DeepSeek / High-Flyer; star counts and inclusion information are subject to the display at the time on each site (GitHub star count is 0 in the materials).
Conclusion¶
dsh-session-delete uses a sidebar menu item and a host deletion route to extend DSH session management from “archiving/hiding” to “permanent removal after confirmation” of main session persistence and registry entries, while handling edge cases involving active sessions and registry timeouts. For more information and installation:
- Plugin Directory: https://www.skillhub.cn/plugins/rhl88/dsh-session-delete
- Source Code and Documentation: https://github.com/rhl88/dsh-session-delete