Introduction¶
The Session menu in DeepSeek Harness (DSH) offers operations such as pin, rename, fork, copy-id, and archive. However, archive merely hides the row, and deleting a Workspace still retains session logs, meaning there is no product-level capability to truly remove a session from disk. This leads to accumulated historical sessions, bloated log directories, and difficulty in thoroughly purging sensitive data. The dsh-session-trash plugin fills this gap by providing a real delete-session action for DSH.
Plugin Overview¶
dsh-session-trash was developed by maintainer pplankero-sudo and is categorized under admin-security. It adds a “Delete session” menu item that removes the Session’s logs, Workspace account records, and title cache all at once. It also refuses to delete running sessions and restricts access to local requests only.
Core Features¶
Deleting Three Stores¶
The delete operation cleans up three stores; missing any one will cause issues:
| Store Location | Purpose | Notes |
|---|---|---|
| Session log | <DSH_HOME>/sessions/<workspace-slug>/<session-id>/ |
The list scans this directory; the row disappears only when the directory disappears |
| Workspace account | <DSH_HOME>/storages/workspace.json → sessionIds |
Records the Sessions owned by the Workspace |
| Title cache | <DSH_HOME>/storages/session_projcache/sessions/<id>.json |
Stores the row title and first prompt |
Archive and pin sets are cleaned up in the same pass. Any leftover remnants will resurrect invisible “ghost rows” after a restart.
Two Safeguards¶
- Running session rejection: Before deletion, the plugin checks whether the Session is currently running. If it is, the button is disabled with a prompt. The Host performs a re-verification before execution to prevent an Agent loop from losing the directory mid-process.
- Local access restriction: The route is authenticated via the DSH signature cookie under the Host’s same origin. Remote requests without the cookie receive a 401 response.
Usage¶
Right-click any Session row in the sidebar (or use the row menu) and select Delete session (the red item) at the bottom. The confirmation dialog lists the log directories that will be destroyed. Once confirmed, the row disappears.
HTTP API¶
/api/dsh-session-trash
GET ?id=session-<uuid>: Read-only probe. ReturnslogDirs,archived,pinned,running,workspaceIds,exists.POST { "sessionId": "session-<uuid>" }: Executes deletion. Returns{ removed: [...], failed: [...], clean: boolean }.
The Session ID must match the regex ^session-[0-9A-Za-z-]{1,120}$; otherwise a 400 is returned.
Installation & Enablement¶
Use the official install command:
dsh plugin add https://github.com/pplankero-sudo/dsh-session-trash
Alternatively, you can manually add it to the profile’s bundles list, with the dependency declared as file:<absolute-path>.
After installation, restart DeepSeek Harness (including the tray process) to activate the plugin.
Typical Workflow¶
- Open DeepSeek Harness.
- Locate the target Session row in the sidebar.
- Right-click or open the row menu, and select Delete session at the bottom.
- Review the log directories that will be deleted in the confirmation dialog.
- Confirm the deletion. The Session row disappears.
Use Cases & Caveats¶
Ideal for developers who need to thoroughly clean up historical sessions, prevent log accumulation, or remove sessions containing sensitive data.
Note: The plugin runs with the current dsh process permissions. Review the source code and license before installing. The plugin itself does not write persistent data; it only operates on the filesystem when invoked.
Conclusion¶
dsh-session-trash fills the gap of true session deletion in DSH, making session management more thorough. Plugin directory page and code repository:
- Directory page: https://www.skillhub.cn/plugins/pplankero-sudo/dsh-session-trash
- GitHub: https://github.com/pplankero-sudo/dsh-session-trash