Introduction¶
DeepSeek Harness (DSH) splits the UI and capabilities into Cordis plugins. Each session row in the sidebar typically carries official menu items such as pin, rename, fork, and archive. If you have accumulated a large number of test sessions or mistakenly opened empty sessions locally, and the sidebar has no “Delete” option, you can only rely on archiving or manually cleaning up disk directories—which is inconvenient and prone to inconsistencies with workspace accounting.
The dsh-session-delete plugin in the plugin marketplace targets an older peer range (^0.1.0-rc.5) and often fails to install on the 0.2.0-rc.2 runtime. Maintainer ljp888 has provided a rewritten version in the GitHub repository ljp888/dsh-session-delete-next: it uses the official slot instead of relying on DOM injection. The community directory page can be found at SkillHub (an independent site with no official affiliation with DeepSeek / High-Flyer).
Below, we introduce what it does, how to install it, how to use it, and the limitations you should know before installation.
What Is This¶
dsh-session-delete-next is a client-side plugin for DSH (split between host and browser), adding a Delete Session item to the … menu of each session row in the sidebar, permanently deleting all local records of that session without recovery.
- Target runtime:
0.2.0-rc.2 - Package version (source):
1.0.0 - License: MIT
- This package is not published to npm; installation follows the repository README. Do not invent commands like
dsh plugin add github:...based on the name.
Core Features¶
Entry Point and Behavior¶
| Entry | Menu Item | Behavior |
|---|---|---|
Session row … menu |
Delete Session | Permanently deletes all local records of that session; unrecoverable |
Key points:
- The dangerous operation uses a red menu item and pops up a separate confirmation dialog clearly stating “unrecoverable,” along with the session title.
- Running sessions are always refused for deletion (including the current session). The host returns
409 live, and the dialog shows a prompt. - After successful deletion, the row disappears from the sidebar immediately, no page refresh needed (reuses the officially forwarded
api-session/removedevent). - Menu text follows the GUI language (Chinese / English) via the official locale service.
Technical Differences from the Old Version¶
0.2.0-rc.2 has opened official extension points. This plugin registers via a standard slot, so it won’t silently break when the sidebar structure changes, unlike DOM injection:
- Host (
index.js): registers a same-origin routePOST /dsh-session-delete-next/deletewith request body{ sessionId }; the deletion order is delete files first, then update accounting to avoid a half-deleted state where “the UI is hidden but disk remains”; cross-siteOriginreturns403. - Client (
client.js): registerssidebar.workspaces.session.menu.item(order: 500, placed after pin/rename/fork/archive) andshell.overlay(confirmation dialog).
Installation and Activation¶
The simplest way is to clone the repository into the profile’s plugin directory (<profile> defaults to ~/.dsh/profiles/desktop):
git clone https://github.com/ljp888/dsh-session-delete-next.git \
~/.dsh/profiles/desktop/node_modules/dsh-session-delete-next
Windows PowerShell:
git clone https://github.com/ljp888/dsh-session-delete-next.git `
"$env:USERPROFILE\.dsh\profiles\desktop\node_modules\dsh-session-delete-next"
You can also manually copy the entire package directory to <profile>/node_modules/dsh-session-delete-next/, then:
- Append a mount line to
<profile>/cordis.patch.yml(the file is watched by HMR and hot-reloads on save):
- insert:
- id: dsh-session-delete-next
name: dsh-session-delete-next
- Refresh the browser once; the “Delete Session” item should appear in the sidebar session
…menu.
Do not add this package to the profile’s package.json dependencies: the package is not on npm, and subsequent pnpm install / dsh plugin commands may try to fetch it from the registry and fail; running pnpm install in the profile may also prune the directory—simply reinstall it.
When the host loads successfully, you should see something like this in ~/.dsh/logs/desktop-next.log:
[dsh-session-delete-next] host ready: POST /dsh-session-delete-next/delete
Typical Usage¶
- Find a finished, non-current-running session in the sidebar (running or still-open sessions will be refused).
- Click that row’s
…and select the red Delete Session. - In the confirmation dialog, verify the session title and click Permanently Delete (or cancel).
- On success, the row disappears from the sidebar; the corresponding session directory on disk should be removed (the entire directory at
~/.dsh/sessions/<project directory>/<session id>/is gone).
If you only have one active session and cannot perform destructive testing, follow the README suggestion: open a new test session → send a message → switch back to the original session → delete the test session.
Use Cases and Cautions¶
Who It’s For
- Agent developers or daily users who are already using the desktop profile on DSH
0.2.0-rc.2and need to individually clean up local session records. - Scenarios where you need a safe entry point from the sidebar for deletion instead of manually deleting directories and causing accounting inconsistencies.
Known Limitations (per source documentation)
- Live sessions cannot be deleted; you must close the session or restart DSH before deleting.
- Sub-agent sessions can be deleted; the parent session sidebar converges via
api-session/removed. - Attachments are not deleted:
~/.dsh/attachments/**is content-addressed and shared across sessions; deleting a session does not touch attachments. - On Windows, if another process holds
session.lock, deletion may reportEBUSY; the dialog shows the raw error, disk state remains unchanged, and you can retry. - Batch deletion by workspace is not implemented; only single sessions are supported.
- Some fail-closed hardening in
index.jsis outside the HMR watch root and requires restarting DSH to take effect in running instances.
Verify Before Installing
The plugin reads and writes the session directory and workspace accounting under the current DSH process permissions. Before installation, read index.js and client.js to confirm the behavior and MIT license are acceptable.
Conclusion¶
dsh-session-delete-next adds “Delete Session” to the sidebar on 0.2.0-rc.2, using official slots and a delete-files-first-then-update-accounting flow to replace dsh-session-delete, which is hard to install due to peer incompatibility. Installation is done by cloning into the profile’s node_modules and appending to cordis.patch.yml.
- Community directory: https://www.skillhub.cn/plugins/ljp888/dsh-session-delete-next
- Source code and documentation: https://github.com/ljp888/dsh-session-delete-next