dsh-session-purge
Manifest validPermanent Session deletion for DeepSeek Harness. · DSH 会话彻底删除插件
dsh-session-purge
English | 中文
Permanent Session deletion for DeepSeek Harness. DSH archives sessions but never deletes them; this plugin adds the missing operation in the place you already look for it.
What it adds
| Where | Row | What it does |
|---|---|---|
| Session context menu | Delete permanently (red, directly under Archive session) | Deletes that session's log directory, projection checkpoint, and workspace record |
| Workspace context menu | Purge archived sessions (N) (red) | Deletes the same files for every currently archived session; hidden while nothing is archived |
Both rows are ordinary ctx.contextMenus contributions rendered by the shipped menu, so font, row height, and padding match every other row — only the color changes (danger: true → the theme's error color).
What gets deleted
The Host resolves $DSH_HOME (default ~/.dsh) and removes:
<home>/sessions/<workspace-key>/<session-id>/— the whole session log directory<home>/storages/session_projcache/sessions/<session-id>.json*— the projection checkpoint and any schema-backup sibling- the id in
workspace.json—archivedSessionIds,pinnedSessionIds, and the workspace'ssessionIdsslot
Left alone on purpose: the content-addressed attachment store (shared by several sessions) and OS temp spill files.
Safety gates
- The route is
POST /__session-purge/purgeand passesctx.connection.requestRejectionfirst: a request without the browser session cookie, or one rejected by the Host/Origin fence, gets 401/403. OnlyPOSTis accepted. - A session still loaded in the Session store (open in a tab) is refused.
- A session whose
workspace/session-activityreports a running turn, job, subagent, or schedule is refused — the same admission archiving uses. - Refusals surface as a toast naming the reason; nothing fails silently.
- Deleting is irreversible, so both rows ask for confirmation first ("彻底删除…无法恢复" style, localized).
Install
From the DSH plugin market:
Settings → Plugins → Add plugin → dsh-session-purge
From the CLI:
dsh plugin add dsh-session-purge
# or straight from this repository
dsh plugin add github:nbcxsm/dsh-session-purge
Restart the DSH host once after installing so the client bundle enters the boot graph.
If you previously installed a local build that registers the same menu contribution id (session.purge), remove it first — two plugins claiming one contribution id is a registration error.
Compatibility
- Requires a Host with
webServer,connection, and theworkspaceRegistryservice (any shipped web/desktop composition). - Client half needs
contextMenus,slots,locale,workspaces; no extra runtime dependency, React comes from the baseline module table. - Verified against a Windows desktop profile on dsh 0.2.x.
Tests
node test/handler-smoke.mjs # route: delete, open-session refusal, bulk, missing id, 405
node test/client-smoke.mjs # menu target/order/danger placement, YAML labels, glyph
License
MIT © nbcxsm @ github.com/nbcxsm
Comments
Loading…