Introduction¶
DeepSeek Harness (DSH) currently lacks a native “delete conversation” verb—conversations can only be archived, and no files are ever removed from disk. While this design is safe, it’s inconvenient for scenarios requiring thorough conversation cleanup. sessionPersistence only offers create, open, refresh, statistics, and listing operations; sessionProjectionCache only supports read/write with no cleanup mechanism; and the documentation explicitly states that cleanup is an out-of-band maintenance task. This plugin fills that gap, enabling deletion to be completed in a single step: the conversation log is moved to the trash, the projection cache is synchronously cleaned, workspace bookkeeping and archive/pin collections are detached, the front-end list updates immediately, and the operation can be restored at any time.
Plugin Scope¶
dsh-session-delete is a client-side plugin developed by maintainer liubaibuliuyan, targeting the DSH 0.2.x series (versions 0.2.1 through 0.2.9, both stable and pre-release). It does not depend on npm and is installed directly from the GitHub repository. It registers with the row ID dsh-session-delete-trash, so it does not conflict with any same-named plugin on npm. The plugin’s core value is providing a revocable conversation deletion workflow to compensate for DSH’s persistence layer lacking native delete capability, while ensuring consistency and safety of the cleanup.
Core Features¶
The plugin breaks deletion down into four actions, all completed in a single step:
-
Move the conversation log directory to the trash: The original conversation directory is moved from
$DSH_HOME/.dsh/sessions/to$DSH_HOME/.trash/session-delete/<entryId>/payload, preserving the complete log files. -
Synchronously delete the projection cache: Removes
$DSH_HOME/storages/session_projcache/sessions/<id>.json, along with any corresponding.bak.<stamp>backup files. -
Clean up workspace bookkeeping: Calls
detachSession,unarchiveSession, andunpinSessionthrough the public API, detaching the conversation from the workspace, archive collection, and pinned collection. -
Update the front-end list: Emits an
api-session/removedevent after deletion and anapi-session/addedevent upon restoration, so changes are visible in the UI without a restart.
Derived child sessions are handled via cascade through header.parentSession—the parent and its forks are deleted or restored together.
Safety Boundaries¶
Before deletion, the plugin checks whether the conversation is actually running. The determination is based on agents.turnBoundaryOf(session).openTurnStartSeq—deletion is only rejected if an unfinished turn exists. The criterion is “is there a turn in progress” rather than “is there a live Agent”: in DSH, once a conversation is opened, the Agent remains resident until process termination. Using Agent existence as the check would make it impossible to delete any currently open conversation.
Other safety measures include:
- Move, don’t wipe: Deletion = renaming into the trash. “Purge” executes
rmand requires a second confirmation. - Touches only two directories: Operates on
sessions/and.trash/session-delete/only; does not modify working directories or other plugins’ storage structures. - Overwrite protection on restore:
meta.originalPathmust reside under thesessions/root; if the target is occupied, the operation is rejected. - HTTP guardrails: Only accepts loopback + same-origin requests; non-loopback traffic is handled by the host’s capability fence.
- No delete tool exposed to Agents: The entry point is reserved for humans to avoid accidental destructive operations.
Usage¶
The plugin provides three entry points, all using in-place confirmation without dialogs:
- Conversation “…” menu → Delete Conversation…
- Hover over a conversation row → Trash can icon in the upper-right corner
- Settings → Delete Conversation → Trash list (Restore / Purge / Scan & clean up residuals)
After clicking the trash can icon, the button transforms in place into ✓ / ✕: ✓ is the red confirm button, ✕ is cancel. ✓ automatically receives focus, supporting Enter to confirm and Esc to cancel. The operation result is reported in a small toast at the bottom-right: on success, the toast auto-dismisses after 2 seconds; on failure or partial failure, it persists and states the reason (conversation running / file locked / not found on disk). The × on the right or Esc dismisses the toast.
Installation & Activation¶
Any of three methods works—none require npm:
# 1. Install from the GitHub repository (recommended)
dsh plugin --profile desktop add github:liubaibuliuyan/dsh-session-delete
# 2. Use the tgz from Releases
# https://github.com/liubaibuliuyan/dsh-session-delete/releases/latest
dsh plugin --profile desktop add ./liubaibuliuyan-dsh-session-delete-1.0.0.tgz
# 3. Clone then install by path
git clone https://github.com/liubaibuliuyan/dsh-session-delete
dsh plugin --profile desktop add ./dsh-session-delete
After installation, restart DSH Desktop (the Host side is only loaded at startup). The appearance of the trash can icon on sidebar conversation rows confirms successful installation.
Uninstallation¶
dsh plugin --profile desktop remove @liubaibuliuyan/dsh-session-delete
Uninstallation does not remove anything in the trash. To clear it as well, you must first purge entries from the trash, or manually delete $DSH_HOME/.trash/session-delete/.
Trash Structure¶
The trash directory is $DSH_HOME/.trash/session-delete/. Each entry contains a subdirectory named with a timestamp and session ID:
$DSH_HOME/.trash/session-delete/
1794900340803-session-867336a9-.../
payload/ ← original conversation directory (contains session.v4.jsonl.zstd)
meta.json ← everything needed for restoration
Example meta.json:
{
"sessionId": "session-...",
"originalPath": "C:\\Users\\<you>\\.dsh\\sessions\\--D-workspace--\\session-...",
"cwd": "D:\\workspace",
"title": "Conversation title",
"deletedAt": 1794900340803,
"root": true
}
Restoration moves payload back to originalPath, re-attaches it to the original workspace, and re-emits the added event.
Compatibility & Known Non-Goals¶
The plugin has been verified on DSH 0.2.2-rc.3 (Desktop 2.0.23-next) and targets the 0.2.x line. package.json declares engines.dsh, enumerating every minor version from 0.2.1 to 0.2.9; a version mismatch causes DSH to refuse installation. The plugin does not parse conversation content—it only works with directory names and session.*.jsonl(.zstd) file names—so upgrades to the log format or projection cache version do not affect deletion.
Known non-goals:
%TEMP%\dsh-spill-*is not cleaned: those directories use truncated hashes of the session ID with no reliable per-session mapping. It’s better to leave them untouched than risk deleting temporary files belonging to other conversations.- Files in the working directory are not deleted: deleting a conversation is not the same as deleting a project.
- No bulk multi-select deletion: the only multi-select is in the trash on the Settings page (Purge / Restore).
Summary¶
dsh-session-delete fills the missing conversation deletion pipeline in DSH. While guaranteeing reversibility, it achieves one-step cleanup of logs, projection cache, workspace bookkeeping, and the front-end list. It uses turn-boundary detection to ensure only truly running conversations are rejected, supports restoration at any time via the trash mechanism, and strictly controls the scope of operations and safety boundaries. For developers who frequently manage conversations, this is a practical and controllable tool.
- Plugin directory: https://www.skillhub.cn/plugins/liubaibuliuyan/dsh-session-delete
- GitHub repository: https://github.com/liubaibuliuyan/dsh-session-delete