Adds a delete row to the menu of an archived conversation only, and after a confirmation removes the session log directory, its projection cache, the archive and pin marks and the workspace booking together.
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/zsenpro/DSH-Quickly-clear/releases/latest/download/DSH-Quickly-clear.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:zsenpro/DSH-Quickly-clear
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
This plugin publishes its README in Chinese only.
DeepSeek Harness 的侧边栏插件:在已归档对话的 ⋯ 菜单里加一项「删除对话」,连会话日志、投影缓存和工作区记账一起清掉。未归档的对话不会出现这一项。
English: a DSH (DeepSeek Harness) plugin that adds Delete conversation to an archived Session's ⋯ menu and removes the session log, its projection cache and its workspace booking along with it. Sessions that are not archived never see the row.
为什么需要它
DSH 有归档,没有删除。归档只是把对话从列表里挪走,磁盘上一份没少:
~/.dsh/sessions/<project>/<sessionId>/session.v4.jsonl.zstd
~/.dsh/storages/session_projcache/sessions/<sessionId>.json
~/.dsh/storages/workspace.json # archivedSessionIds / sessionIds
Host 服务里也确实没有删除口子:workspaceRegistry 能归档、置顶、改名、把会话从工作区摘出来;sessionPersistence 只能 create / open / flush / stat / list;内存里的 sessions 连删都不谈。这个插件补的就是这一块。
装上
要求:DSH 桌面版或 dsh web(走 profile 机制),Node >= 20。
把仓库放到任意目录,然后二选一。
首选:插件管理器
plugin_manager install_bundle target=<克隆目录>
install_bundle 会给 profile 加依赖并挂上 bundle。如果你的 profile 里已经有需要本地编译的依赖(比如带 cpu-features 的包),pnpm 那步会卡在 install script 批准上,那就走下面的手工登记。
手工登记(本地 link)
跟 @yg/dsh-session-mover 之类的本地插件一个形态:
$src = '<克隆目录>'
$profile = Join-Path $env:USERPROFILE '.dsh\profiles\desktop'
New-Item -ItemType Junction -Path (Join-Path $profile 'node_modules\DSH-Quickly-clear') -Target $src
然后编辑 $profile\package.json 两处(路径用正斜杠):
{
"dependencies": {
"DSH-Quickly-clear": "link:<克隆目录>"
},
"dsh": {
"profile": {
"bundles": [
// ... 其它 bundle
"DSH-Quickly-clear"
]
}
}
}
改动 index.js 需要重启 DSH Host;只改 client.js 走 HMR。
卸载
从 bundles 里删掉那一行、删掉依赖项、删掉 Junction,再删掉 ~/.dsh/DSH-Quickly-clear.log。
用法
- 归档一个对话(
⋯→ 归档对话)。 - 再打开它的
⋯菜单,最后多出一行「删除对话」。 - 点它,确认卡片里会写出会话标题和后果,再点「永久删除」。
删除成功后页面会自己刷新一次。侧边栏的会话目录是客户端快照,Host 删文件碰不到它,不重挂那一行会赖着不走。
它删什么
POST /DSH-Quickly-clear/api/delete,按顺序:
- 所有 workspace 记录的
sessionIds摘掉这个 sessionId(workspace.mutate,写盘) unarchiveSession+unpinSession- registry 的
headers/sessionPaths/missingSessionPaths/invalidSessionPaths四个缓存清掉——不清的话下一次快照会从 cwd 索引把它重新推导回工作区 sessions/<project>/<encodeSegment(sessionId)>/整目录删除,project 目录空了顺手收掉storages/session_projcache/sessions/<sessionId>.json- 再清一次 registry 缓存(清扫期间重建的投影可能又读过 header)
先清记账再删文件是有意的:文件删不掉(Windows 上句柄没放)时会话仍然能解析、仍然显示在侧边栏里,不会留下一个指向空处的行。
正在运行的会话会被拒(session-live)。归档本身会停掉会话,正常路径撞不上。
它不删什么
attachments/v1/objects/:内容寻址,多个会话共用同一份字节,没法按会话归属。storages/cost-meter/ledger.json:按会话记账的共享文件,动它的风险大于收益;删掉会话后那笔花费仍留在历史账单里。sessionQuery的 SQLite 全文索引:服务没有删除方法,搜索里可能还留着陈旧命中。
端点
给二次开发用的两个口子,都要过 ctx.connection.requestRejection(同源 / 可信连接校验):
| 方法 | 路径 | body | 作用 |
|---|---|---|---|
| POST | /DSH-Quickly-clear/api/delete |
{"sessionId":"..."} |
执行清扫,返回删掉的路径与记账 |
| POST | /DSH-Quickly-clear/api/inspect |
{"sessionId":"..."} |
只读:列出命中的日志目录、缓存文件、是否在运行 |
调用记录写在 ~/.dsh/DSH-Quickly-clear.log。
验证
node verify.js
19 项自检,分两层,全在临时目录里跑,不连 Host、不碰真实数据:
- 纯函数:
encodeSegment对普通 uuid / IM 形态 id(:→~003A)/~/./..;findSessionFolders命中与未命中;projectionCacheFiles只认本会话的文件。 - 清扫流程(桩服务替
sessions/workspaceRegistry/sessionPersistence):记账摘 id、归档与置顶标记清除、日志目录与投影缓存被删、空 project 收掉、registry 四个缓存清空、运行中的会话被拒且文件不动、只有记账没有日志也能收尾。
实现备忘
- 菜单行注册进
sidebar.workspaces.session.menu.item,cell idquickly-clear,order: 500(出厂行是 pin 100 / rename 200 / fork 300 / archive 400 / session-id 450)。可见性读useWorkspaces(...).archivedSessionIds,未归档的会话直接不渲染。 - 确认框注册进
shell.overlay,cell idquickly-clear-dialog,order: 940。Esc、点背景、取消都能退;删除中两个按钮都禁用。 - 不
require任何 Harness Client 包(@deepseek-ai/dsh-client-ui-primitives之类),控件、图标、hover 样式自己写,颜色只吃--dsw-alias-*token 并带硬编码回退值。 - 会话目录名的编码跟 JSONL store 保持一致,见
encodeSegment:~与非[A-Za-z0-9._-]转~XXXX,.与..特判。
License
MIT
Links
More in this category
Minglink/dsh-infinite-gen-4★ 3781
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.
ranxianglei/billion-context★ 3598
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).
liangmianya/dsh-synapse★ 641
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
MichengAI/dsh-archive-manager★ 277
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 275
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.
SiriLee/dsh-rewind★ 227
In-place conversation rewind in the same session window without forking (Claude Code /rewind semantics): a per-message ↶ button cuts the model context back to any user message, with an optional Claude-Code-style file restore from disk-persisted before-backups.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.