Adds a red "Delete session" row beneath Archive in the sidebar session menu and permanently deletes that one session - its stored logs and its workspace account entry, written through the workspace registry itself. A second click confirms and the row leaves the list immediately; sessions opened this run are disposed from memory first so nothing resurrects them, and a session running work shows one extra warning whose click stops the task before deleting.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/EarthPretender/dsh-session-delete/releases/latest/download/dsh-session-delete.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:EarthPretender/dsh-session-delete
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 中文
Adds a destructive red "Delete session" row right below "Archive session" in the Session "…" menu of DeepSeek Harness (DSH) — it actually deletes the session's data instead of only archiving it.
Tags:
dsh-plugin·dsh·deepseek-harness
What it does
DSH ships Archive only: an archived session stays on disk and can be restored. This plugin adds real deletion:
- Menu row — a red "Delete session" row (trash icon, separator) beneath the shipped "Archive session" row in every sidebar Session's "…" menu.
- Two-step confirm — the first click arms the row ("Click again to confirm", auto-reset after 6s), the second click runs it; the menu stays open and shows the outcome inline. When the session is running work, the row arms a second warning ("Click again: stop the task and force-delete") whose next click stops the task first; any other refusal (unreachable host, locked file) shows its reason in the row, stays red, and re-arms on the next click.
- What gets deleted
- the session's stored logs under
sessions/<workspace>/<session-id>/(includingsession.v4.jsonl.zstd); - its registry accounting, through the workspace registry's own durable writes (
unpin→unarchive→detachSession), soworkspace.jsonis written by the registry itself — memory and disk never disagree, and later archives cannot resurrect the deleted id.
- the session's stored logs under
Safety
- Sessions opened this run delete normally — the plugin disposes the session from memory first (flush → detach the store entry → deregister the agent, session strictly before agent: while
ctx.sessions.get(id) === agent.sessionstill holds, DSH re-publishes the row), the write handle closes with it, and the log removal carries a bounded lock retry (15 × 100 ms). Nothing can "half-delete" or resurrect, and no restart is needed. - Running sessions: one warning, one more click, force-delete — when the host reports running work, the row arms "Click again: stop the task and force-delete" (auto-reset after 6s); the next click dispatches the official
workspace/session-stopfirst and waits up to 4 s (tunable viaSESSION_DELETE_STOP_WAIT_MS). A task that refuses to stop does not block the delete — that is what force means. - The row disappears from the list immediately, no restart needed — the plugin broadcasts the official
api-session/removedevent (forwarded to every browser bydsh-api-remotes), the exact channel DSH itself uses to drop rows. Without it a cold session's row stays in the browser's start-up snapshot, stranded in the "Ungrouped" bucket until a restart. An idempotent repeat re-broadcasts as well, to clear any stale leftover row. - Official auth — the delete endpoint rides DSH's shared
/apiconnection channel (connection.registerFetchRoute), so Host/Origin checks and browser authentication are enforced by the officialadmit()gate. - Idempotent — clicking again, or acting on an already-deleted session, answers "already removed" rather than erroring.
- Irreversible — logs and accounting are removed; only shared attachments/projection caches remain as harmless orphans.
Install
Via the plugin market (recommended)
Search and install from DSH's plugin market (dshmarket); this repo carries the community dsh-plugin tag.
Manual (github spec)
Edit the profile package.json (~/.dsh/profiles/desktop/package.json):
{
"dsh": { "profile": { "bundles": [ "dsh-session-delete" ] } },
"dependencies": { "dsh-session-delete": "github:EarthPretender/dsh-session-delete" }
}
Then run pnpm install in the profile directory and restart DeepSeek Harness.
Usage
- Restart DSH after installing.
- Hover a sidebar Session row → "…" → the red Delete session row at the bottom.
- First click arms, second click deletes; the result shows in the row and the row leaves the list immediately.
- If the session is running work, the row shows "Click again: stop the task and force-delete" — one more click stops the task and deletes.
The plugin appears as a card in Settings → Plugins and can be toggled there.
Uninstall
Remove dsh-session-delete from dsh.profile.bundles and dependencies, run pnpm install, restart.
Compatibility
- DSH
0.2.0-rcline (Web / Desktop profile). - Host half: Node ≥ 22. Client half uses DSH platform baseline modules (React,
@deepseek-ai/dsh-client-ui-primitives).
Layout
| Path | Purpose |
|---|---|
lib/index.js |
Host half: POST /api/session-delete, log removal + registry bookkeeping |
lib/client.js |
Client half: the "Delete session" row in sidebar.workspaces.session.menu.item |
cordis.patch.yml |
Bundle patch inserting one loader row carrying both halves |
icon.svg |
Plugin card icon |
scripts/selftest.mjs |
Dependency-free self-test (npm test); no DSH needed |
Development self-check
npm test # = node scripts/selftest.mjs
No DSH required. It covers three things:
- Identity — the
package.jsonname, the id inlib/client.js's__ModuleLoader__.load({ id }), and thenameof thecordis.patch.ymlinsert row must all be the same string. When they drift, client-modules reportsloaded without registering "…" via __ModuleLoader__.loadand the browser half never activates — Settings then shows "some plugins could not sync on this page". - Browser half — the two-step confirm, the force warning row for a busy session (third click sends
force: true), success/refusal/transport-error outcomes, retry after a failure, and the registered slot's name/id/order/locale. - Host half — the route contract (
POST /api/session-delete, buffered body), malformed method/JSON/path traversal, the 409 for a busy session withoutforce, the forced path's fixed order (stop → flush → dispose → deregister agent), the bounded wait when providers ignore the stop, disposing then deleting an attached session, the refuse-not-half-delete fallback when the store cannot detach, a real delete (log dirs +unpin/unarchive/detachSession+ header-index rebuild), theapi-session/removedbroadcast, idempotence, and the 500 when the store is unreadable.
Renaming the package (for example
@local/dsh-session-delete→dsh-session-delete) means changing all three places and restarting the app: a running page still holds the client module row under the old id, and editing files does not replace it.
License
Links
More in this category
ranxianglei/billion-context★ 8746
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Minglink/dsh-infinite-gen-4★ 4848
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 860
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
ECNU/EduWork#dsh-side-chat★ 435
Open temporary side conversations from a message with a snapshot of its history, then archive them on close; optional annotation integration adds selection-based questions. Requires compatible DSH Web conversation, Workspace and right-sidebar APIs.
MichengAI/dsh-archive-manager★ 407
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 335
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.