Introduction¶
The session menu in the DeepSeek Harness (DSH) sidebar currently only provides rename, fork, and archive features. Archiving merely hides the session and does not clean up local log data; to stop a running session, users often need to open the session first and then click the stop button. This operation path increases management overhead.
The dsh-session-remove plugin returns the “stop work” and “permanently delete data” actions directly to the place users click most often: the menu on each sidebar session row.
Plugin Overview¶
- Name:
dsh-session-remove - Maintainer: BG0EXM
- License: MIT
- Core Value: Directly adds “Stop” and “Delete” options to the sidebar session menu for managing the session lifecycle.
Core Features¶
- Menu Extension: Adds “Stop Session…” and “Delete Session…” options to the sidebar session menu.
- Stop Session: Cancels running turns, sub-agents, background tasks, and scheduled reminders.
- Permanent Deletion: Deletes the session log (
session.v4.l.zstd), projection cache, and workspace records. - Event Notification: Notifies the sidebar to remove the row via the official event
api-session/removed. - Update Prompt: Checks for updates and prompts (prompt only, no silent replacement).
Installation and Dependencies¶
Before installation, ensure the host DSH version is 0.2.0-rc.2 or higher.
# 桌面版:侧栏 → 插件 → 添加插件 → 填包名
dsh-session-remove
# 其它 profile(web / tui / 自建)
dsh plugin --profile web add dsh-session-remove
No DSH restart or page refresh is required after installation.
Typical Usage¶
- Hover the mouse over any session row in the sidebar.
- Click the ⋯ menu.
- Select Stop Session… to cancel the current run.
- Select Delete Session… to permanently remove local data.
Implementation and Security Boundaries¶
The plugin does not use DOM injection or React Fiber traversal; instead, it is implemented through official extension points to avoid breakage caused by core UI updates.
Menu Registration¶
Menu items are registered into the official slot sidebar.workspaces.session.menu.item and sorted by order with other menu items.
Deletion Flow¶
Deletion is performed through the public APIs of ctx.workspaceRegistry and storageDomain. To ensure data consistency, the execution order must be strictly followed:
- Release the session: Release the session’s write handle first.
- Stop work: Call
ctx.workspaceRegistry.stopSessionActivity(). - Wait for counters to clear: Confirm that all tasks have finished.
- Delete files: Remove the session directory and cache.
If you try to delete a session that is still running, the plugin rejects the operation and prompts “Stop and Delete”. The stop action discards queued input.
Deleted Content¶
| Location | Content |
|---|---|
$DSH_HOME/sessions/<项目>/<会话id>/ |
Session log (session.v4.jsonl.zstd) and write lease |
session_projcache storage domain |
Projection checkpoint records |
$DSH_HOME/storages/workspace.json |
Workspace member position, pinning, and archive records |
Notes¶
- Zero dependencies, zero build: No extra environment is required; install and use it immediately.
- Irreversible: Deletion cannot be undone, and there is no recycle bin feature.
- Update Activation: After updating the plugin, the host module must be restarted for changes to take effect.
- Attachment Handling: Attachments are content-addressed and deduplicated; the plugin only deletes the session directory and does not reclaim attachments by session.
Troubleshooting¶
The plugin runtime log is located at $DSH_HOME/plugin-session-remove.log and can be used to troubleshoot installation or execution issues.
Ecosystem Links¶
- GitHub: https://github.com/BG0EXM/dsh-session-remove
- Catalog Page: https://www.skillhub.cn/plugins/BG0EXM/dsh-session-remove