Introduction¶
When developing agents long-term in DeepSeek Harness (DSH), the sidebar accumulates a large number of sessions: each session corresponds to an event log directory and a replay projection cache. Relying solely on manually deleting directories in the file system often leads to overlooking the cache under storages/session_projcache. Furthermore, for sessions currently open, hard deletion is impossible while the process still holds their state. The following introduces the community plugin dsh-session-delete (Maintainer: ashulam, Category: Client), which integrates “Delete session” into the context menu of the sidebar Session rows. It follows two paths—immediate deletion or cleanup queued for the next startup—depending on whether the session is in a live state during the current run.
What is this¶
dsh-session-delete is a client plugin for DSH: In the sidebar session list, hover over a row and click ⋯, and Delete session will appear in the menu. The plugin performs recoverable physical deletion for “cold” sessions; for “live” sessions, it writes to a deletion queue, clearing the queue and removing files when DSH starts up next time. The implementation is divided into Host-side HTTP routes and browser-side menu items/startup notifications, relying on slots provided by DSH 0.2.x such as sidebar.workspaces.session.menu.item and shell.overlay.
Core Features¶
Context Menu Deletion¶
Operation path: Hover over session row → Click ⋯ → Delete session. A confirmation dialog will pop up before deletion.
Behavior Distinguished by Session Status¶
| Session Status | Behavior |
|---|---|
| Cold (Not loaded in this app run) | Delete immediately; The logs and replay cache of the session are moved to the Windows Recycle Bin (fallback to <DSH_HOME>/.session-trash/ on non-Windows systems). The sidebar refreshes itself via the client Session controller, requiring no full page reload. |
| Live (Currently open, or opened during this run) | DSH does not provide a “Close Session” API, so files cannot be safely deleted at runtime. The plugin can queue them: POST /dsh-session-delete/queue writes to <DSH_HOME>/.session-delete-queue.json. On the next startup, the queue is drained before any sessions are opened. |
If the queued sessions are cleaned up after a restart, a small notification will appear in the corner of the interface: listing the titles of deleted sessions (up to five, with the rest showing a count) and reporting entries that failed to delete and remain in the queue.
Files Actually Deleted¶
For a given session id, the plugin removes:
| Path | Content |
|---|---|
<DSH_HOME>/sessions/<project>/session-<id>/ |
Append-only event log directory |
<DSH_HOME>/storages/session_projcache/sessions/<id>.json |
Replay/projection cache |
It will not touch attachments (shared, content-addressed blobs); the sessionIds entries in the Workspace registry are also preserved—since there is no “Unregister Session” API in the registry, the sidebar will skip that id when the corresponding storage no longer exists.
Safety and Recovery¶
- Direct deletion of live sessions is rejected (HTTP
409); it can only be deleted via queueing for the next startup. - HTTP routes are located within the Host’s browser trust boundary (
connection.requestRejection) and only accept ids in thesession-<uuid>format. - Deletion is recoverable: Windows Recycle Bin, or timestamped directories under
<DSH_HOME>/.session-trash/.
Installation and Activation¶
The plugin is listed in the DSH plugin marketplace; it can also be installed manually according to the README. The official command is as follows (note the syntax for the profile and add subcommands):
dsh plugin --profile desktop add github:ashulam/dsh-session-delete
For local checkouts, you can use pnpm add file:<path to this repo> in the profile directory and add dsh-session-delete to dsh.profile.bundles in package.json.
Typical Usage¶
- After installing and enabling the plugin in the DSH desktop profile, open the interface with the workspace sidebar.
- For sessions that are no longer needed and are currently not open: Hover over the row → ⋯ → Delete session → Confirm. Logs and projection caches go to the Recycle Bin (or
.session-trash), and the sidebar list updates automatically. - If the session to be deleted is currently open or has been opened during this run: Choose “Queue deletion” in the confirmation flow; after completely quitting DSH and starting it again, the startup phase will process the queue and display a summary of the cleanup results in the corner.
The Host side also provides routes such as POST /dsh-session-delete/delete and GET /dsh-session-delete/last-drain (see lib/index.js in the repository); daily usage primarily relies on the sidebar menu.
Use Cases and Notes¶
Target Audience: Developers who need to routinely organize sessions in the DSH sidebar and want to clean up logs and session_projcache together; on Windows, the system Recycle Bin can be prioritized for accidental deletion recovery.
Environment Requirements: DeepSeek Harness 0.2.x; Recycle Bin behavior is fully supported on Windows, while other platforms use the .session-trash directory as a fallback.
Permissions and Trust: The plugin reads and writes <DSH_HOME> and calls Host HTTP interfaces with the permissions of the current DSH process. Before installation, it is recommended to read the source code and the MIT license at the GitHub Repository to ensure compliance with your security policies. The community directory site has no official affiliation with DeepSeek / High-Flyer; the plugin comes from community maintainer ashulam.
Conclusion¶
dsh-session-delete consolidates session deletion into a single path via the sidebar menu: cold sessions go to the Recycle Bin (or trash directory) immediately, hot sessions are queued for the next startup, and it explicitly deletes only logs and projection caches without touching attachments. For more information, see the SkillHub Directory Page and GitHub: ashulam/dsh-session-delete.