插件目录 / Developer / dsh-session-cleaner
dsh-session-cleaner
已验证 · 实测可装 fountunt
功能简介
(无描述)
可用 — 实测通过,早期项目
(无描述) 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-session-cleaner
Delete DeepSeek Harness sessions from a running web runtime — files, live
store, and workspace records — without restarting dsh web.
The official web API only offers workspace.archiveSession (hide); there is nosession.delete. This bundle closes that gap.
Install
dsh plugin --profile web add dsh-session-cleaner # from npm
dsh plugin --profile web add github:fountunt/dsh-session-cleaner # from git
# or from a local checkout
dsh plugin --profile web add file:/path/to/dsh-session-cleaner
Then restart dsh web (a running instance does not hot-load new bundles).
Usage
Web UI (v1.0.0)
The client half adds a 🗑 "Delete session" item at the bottom of the
sidebar session row ⋮ menu — the item is skipped when the row title is
ambiguous (duplicate titles).
Click, confirm, and the session is deleted and the sidebar refreshes. The
item is disabled (greyed) while the session is running; sessions opened in
the UI (idle agents) are stopped first, then deleted. The current running
conversation can never be deleted.
API
The plugin registers one route on the web server:
POST /api-ext/session.delete
Content-Type: application/json
{ "sessionId": "session-1bb8d361-ea6b-4b92-bab2-c858c92e8822" }
Same-origin calls work from the browser console of the harness page:
await fetch("/api-ext/session.delete", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ sessionId: "session-1bb8d361-ea6b-4b92-bab2-c858c92e8822" }),
}).then(r => r.json());
Response envelope (mirrors the host's RPC style):
{ "ok": true, "value": { "detached": true, "workspaces": 1, "files": 1 } }
{ "ok": false, "error": { "code": "refused", "message": "..." } }
detached— the session was removed from the in-memory live store (this is
what makes it disappear from the sidebar immediately, without a restart).workspaces— how many workspace records the session was detached from.files— how many on-disk artifact directories were removed.
Safety
- Sessions with an attached agent (running or idle) are refused — the
current conversation can never be deleted through this endpoint. - Deletion is irreversible: artifacts, workspace membership, and the live
entry are all removed. The session-projection cache may keep a harmless
stale row until the next restart.
How it works
session.list is served from the live SessionStore plus a disk scan. Cold
sessions get prepared into the live store while being listed, so after their
files are deleted they linger as "ghosts" until the server restarts. This
plugin removes the live entry (the store's own detach path), detaches the
session from workspace records, and deletes the on-disk artifact directory —
so the row disappears immediately and permanently.
Development
pnpm install # peer: @deepseek-ai/cordis
node --test test/ # unit tests
License
MIT
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-session-cleaner」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
Web profile:
dsh plugin --profile web add dsh-session-cleaner Headless(CLI)profile:
dsh plugin --profile headless add dsh-session-cleaner 包信息
npm:dsh-session-cleaner · 版本 1.0.0 · 实测环境 dsh 0.1.0-rc.6
实测报告
端到端验证通过:dsh 0.1.0-rc.6 上 L1 安装 + L2 加载 + L3 运行问答。
使用场景
扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。
适合谁
想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。
二次开发建议
工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。