- Home
- Plugins
- Sessions & Messages
- dsh-archive-purge
dsh-archive-purge
mulholland-drive/dsh-archive-purge
Permanently deletes archived sessions, which DSH otherwise keeps on disk forever because it ships no delete API. A right-click action on an archived session, or an archive_purge tool with a dry-run preview, removes the conversation log, the projection cache row, and the workspace archive entry.
Install
dsh plugin --profile web add github:mulholland-drive/dsh-archive-purgeREADME
dsh-archive-purge
English | 中文
Permanently delete archived sessions in DeepSeek Harness. Right-click an archived session in the sidebar, choose Delete permanently, confirm — the conversation log, its projection cache, and its workspace entry are gone for good.
Archiving in DSH is deliberately non-destructive: the session is hidden, but its log stays on disk. DSH ships no delete API, so archived sessions accumulate forever. This plugin fills that gap.
Install
Three steps:
-
Get the code. Download this repository (green Code button → Download ZIP, then extract) or clone it:
git clone https://github.com/<you>/dsh-archive-purge.git -
Add it to DSH. Open Plugins → Add plugin and pick the extracted/cloned directory — the one containing
package.json. If the plugin-manager tool is available, the same thing is:{ "action": "install_bundle", "target": "/absolute/path/to/dsh-archive-purge" } -
Restart DSH. The Web half is a client bundle, and it is served only after a restart.
Once installed, the sidebar's session context menu gains a Delete permanently entry for archived sessions. Nothing else to configure.
Usage
From the sidebar
Show archived sessions (the sidebar's view filter), then right-click one. Its context menu gains a red Delete permanently entry below the built-in actions. Choosing it opens a confirmation dialog; nothing is removed until you press Delete permanently in that dialog.
The entry appears only for archived sessions — an active or unarchived session never shows it.
From the agent
An archive_purge tool is registered for the agent:
| Parameter | Meaning |
|---|---|
dryRun | Report what would be deleted without deleting anything |
ids | Limit the purge to specific archived session ids; omit for every archived session |
What a purge removes
Three places hold a session id:
| Location | Contains |
|---|---|
~/.dsh/sessions/<project>/<session-id>/ | the conversation log (session.v4.jsonl.zstd) |
~/.dsh/storages/session_projcache/sessions/<id>.json | the projection checkpoint cache |
~/.dsh/storages/workspace.json | the archive set and workspace session lists |
$DSH_HOME overrides the home directory when set.
How it avoids the "ungrouped ghost"
Deleting the files alone is not enough. Three details make the difference:
- The log goes before its cache row. The cache rebuilds a missing row from the log on the next cold read, so deleting the row first lets the sidebar re-list the session immediately.
- A live session must leave the process too.
sessionQuery.listSessions()merges persisted records with the in-memory store, so a session still held in memory survives every file delete and lingers as an ungrouped stray. - The browser must re-pull. The sidebar renders a snapshot pulled by
sessions.list, so a server-side delete stays invisible until the page refreshes its list — which the UI half triggers after each successful purge.
A purge also sweeps orphaned cache rows: rows whose log is gone can only re-list a deleted session, so they are removed as well.
Limitations
- Not transactional. A locked file is reported as a failure and stays on disk; re-running the purge finishes the job.
- JSONL backend only. Only the shipped JSONL persistence layout is handled.
- Live sessions. Deleting a session that another window is actively running will end that window's conversation. Prefer deleting sessions you have closed.
- Not undoable. There is no trash folder.
Development
The plugin needs no build step: index.js (Host) and client.js (Web) are hand-written ESM and
plain-JavaScript respectively.
index.js Host half: the archive_purge tool and the Client-callable purge endpoint
client.js Web half: the context-menu action and its confirmation dialog
cordis.patch.yml Loader patch inserting the plugin row
locale/*.json Plugin-manager title/description (en, zh)
docs/DETAIL.md Plugin detail page
icon.svg Plugin icon
License
MIT — see LICENSE.
Related plugins
billion-context
ranxianglei/billion-context
dsh-web-ui (dsh-chat-recovery)
zhu1090093659/dsh-web-ui
dsh-synapse
liangmianya/dsh-synapse
EduWork (dsh-side-chat)
ecnu/eduwork