Introduction¶
The “Archive Session” feature in the DeepSeek Harness (DSH) sidebar only hides conversations from the list; the session logs remain under ~/.dsh/sessions/. The official documentation for @deepseek-ai/dsh-session-persistence-jsonl states in its known limitations that the persistence layer lacks a delete API, and logs accumulate indefinitely unless cleaned up by external tools. If you have tried multiple projects or sub-sessions locally, or need to compliantly erase the persisted content of a specific conversation, relying solely on archiving does not solve the question of “whether it still exists on disk.” The following introduces the community plugin dsh-plugin-session-delete (Maintainer: Yelj20001223, Category: Client), which provides true deletion capabilities in the Web GUI session row menu.
What is this¶
dsh-plugin-session-delete adds a “Delete Conversation…” entry to the “…” menu of each session row in the DSH Web GUI sidebar. It deletes the corresponding session directory and projection cache records on the host side, rather than just hiding them at the UI level. The plugin version is 0.1.0, depending on DSH >=0.2.0-rc.1 and Node >=18. License: MIT. Directory page: SkillHub Plugin Page; Source code: GitHub Repository.
Differences from Native Archiving¶
| Capability | Native “Archive” | This Plugin |
|---|---|---|
| Display in Sidebar | Hidden | Removed via api-session/removed sync after deletion |
| Session Directory on Disk | Retained | Deletes <root>/--<project>--/<id>/ (including all generation logs) |
| Undoable | Can unarchive | Irreversible, no trash bin |
Core Features¶
- Menu Entry: “Delete Conversation…” is placed after the official “Archive Session”.
- Multi-select & Confirmation: The dialog lists all sessions (including archived and sub-sessions) and allows multi-selection; manual input of
DELETEis required to confirm. - Disk Deletion: The host deletes the session directory and cleans up the corresponding records in the projection cache.
- Running Interception: Sessions with active Agents or currently producing turns within the current process return
blocked; only opened and idle sessions are allowed to be deleted. - Switch Away After Deleting Current: If the currently open conversation is deleted, the main panel returns to a blank new session page.
- Hot List Update: Emits
api-session/removedafter deletion; connected pages update the sidebar without a refresh.
Host-side HTTP Interface (available after Host / Origin validation):
GET /session-delete/candidates → { ok, sessions: [{ sessionId, title, cwd, origin, createdAt, sizeBytes, archived, running }] }
POST /session-delete/delete → { ok, deleted[], blocked[{ sessionId, reason }], failed[{ sessionId, message }] }
body: { "sessionIds": ["<id>", …] } (1..500)
Installation and Activation¶
Execute from the DSH repository root (<harness>); the desktop profile is managed by the desktop client, please use the desktop command line. The installation command must use link:, do not use file:—file: copies a physical directory, requiring a re-add after code changes; link: acts as a directory junction on Windows, taking effect immediately after changes (and with HMR, a restart isn’t even necessary).
dsh plugin --profile desktop add link:<repo_path>/session-delete
Uninstallation:
dsh plugin --profile desktop remove dsh-plugin-session-delete
The plugin runs with the current DSH process privileges; please read the repository source code and the MIT license yourself before installation to ensure the deletion behavior complies with your environment policies.
Typical Usage¶
- Open the “…” menu on the target session row in the sidebar and select “Delete Conversation…”.
- Check the sessions to delete in the dialog (can include archived items or sub-sessions marked with
subagent). - Read the consequence description, type
DELETE, and confirm. - If a session is currently running an Agent within this process, it will appear in the
blockedresult and will not be deleted; other successful items will be removed from the disk, and the sidebar will update synchronously.
For batch deletion, sessionIds accepts up to 500 IDs at a time, completed by the GUI calling the host’s POST /session-delete/delete.
Security Design (Host-side)¶
The host does not trust paths passed by the client. It re-derives the directory based on the stat() from the persistence backend and the cwd, id in the session log header, and the ID must strictly fall within the root. If the corresponding log ID is not found, it returns a failure and will not falsely report “deleted”. Sessions with active writers are intercepted again before deletion; the route returns 403 for requests with mismatched Host or Origin, reducing the risk of local port abuse via cross-site requests.
Applicable Scenarios and Notes¶
Suitable for: DSH desktop Web GUI users who need to clean up historical conversations on disk, archive sessions still taking up space, or wish to remove sub-session directories individually (deleting a parent session does not cascade to delete sub-sessions).
Limitations to be aware of (from README known limitations):
- Deletion is irreversible; implemented as
rm(..., { recursive: true, force: true })on the session directory. - Does not cascade cleanup for
~/.dsh/attachments/and workspace records; attachments may remain on disk after session deletion but will no longer be referenced. - The “running” determination is from the perspective of the current process; a session being written by another DSH process might be judged as deletable by this process (the backend has a single-writer lock, which falls under the operator explicitly intending to delete).
- The community plugin directory SkillHub is an independent site with no official affiliation with DeepSeek / High-Flyer; stars and ecosystem status are subject to display on respective sites (current GitHub stars are 0).
For local verification, you can run the tests in the repository (this does not modify data in your real ~/.dsh/sessions/; host.spec.mjs only reads and copies samples to a temporary directory):
node tests/host.spec.mjs
node tests/client.spec.mjs
Conclusion¶
The DSH ecosystem emphasizes “everything is a plugin”; dsh-plugin-session-delete fills the gap of the “external deleter” missing in the session persistence layer, translating Web GUI operations into real directory deletions, and reduces the risk of accidental deletion with running refusals and confirmation thresholds. For installation instructions and API details, refer to the GitHub README; to browse the entry on the directory site, see SkillHub.