删除 DeepSeek Harness 会话中的一整轮对话(提问 + 回答 + 工具调用),不影响会话本身。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-turn-hard-delete
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:shuanzhe/dsh-turn-hard-delete
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
Delete one complete closed turn (question + answer + tool calls) from a DeepSeek Harness session, without deleting the session. The deletion is recorded in the session log, so the turn stays gone after reloading.
删除 DeepSeek Harness 会话中的一整轮对话(提问 + 回答 + 工具调用),不影响会话本身。删除结果写入会话日志,刷新后不会复活。
Install / 安装
dsh plugin --profile web add dsh-turn-hard-delete
Requires the plugin to be registered in the profile's dsh.profile.bundles (the add command does this automatically). Restart the web service afterwards.
需要重启 dsh web 服务后生效(dsh plugin add 会自动写入 bundles 登记)。
Usage / 用法
- Hover over a message in the chat. / 鼠标悬停到对话消息上。
- Click the Delete this turn / 删除这一轮 button in the turn tail. / 点击轮次尾部的"删除这一轮"按钮。
- Confirm in the dialog. / 在弹出的确认框里确认。
The whole turn disappears from the UI immediately; the tombstone written to the session log keeps it hidden on reload. Only fully closed turns can be deleted; a running turn must finish first.
删除后整轮立即从界面消失;写入会话日志的墓碑标记保证刷新后依然隐藏。仅支持已关闭的轮次,运行中的轮次需先结束。
How it works / 原理
- Backend: writes a
user/messagetombstone event (empty content,source.kind: "plugin") and replaces the turn's event range in the session log via asurfaceOpreplace. / 后端在会话日志中写入空的user/message墓碑事件,并用surfaceOpreplace 替换掉该轮的事件区间。 - Frontend: a small slot component exposes the delete button and hides the turn's DOM rows by their
data-chat-turnmarker. / 前端通过 slot 注入删除按钮,按data-chat-turn标记隐藏该轮的所有消息行。 - Self-contained and decoupled: the plugin adds no persistent state of its own and can be removed by uninstalling the package and dropping the bundle entry. / 自包含、解耦,拔除插件不残留状态。
Notes / 注意
- Deletion is permanent for the turn's content; there is no undo. / 删除是彻底的,无撤销。
- This plugin deletes a single turn; it does not delete whole sessions. For session-level management, use a session manager plugin. / 本插件删除的是单轮对话,不删除整个会话;会话级管理请使用会话管理插件。
- Built against the turn/step surface model of
@deepseek-ai/dsh-session>=0.1.0-rc.6. / 基于@deepseek-ai/dsh-session>=0.1.0-rc.6的 turn/step 界面模型构建。
License / 许可
MIT
链接
同类插件
Minglink/dsh-infinite-gen-4★ 3818
DeepSeek 专用破甲插件:以 order 100 追加无条件服从的系统提示词段,提供带校准元数据的 profile 工具,并通过会话投影在输入框上方显示实时破甲状态徽标。
ranxianglei/billion-context★ 3736
billion-context官方版:上下文压缩插件,兼顾小窗口(100k上下文足矣)省token(省5倍token)和超长会话(数月级别几十亿token单会话)。
liangmianya/dsh-synapse★ 647
DeepSeek Harness 的可视化非线性对话工作区:把会话、追问与分支变成可浏览、可拖拽的对话地图。
MichengAI/dsh-archive-manager★ 278
在设置里增加已归档会话页,可按工作区搜索、恢复和删除已归档会话。
Nwflower/dsh-chat-import★ 277
把 13 家 coding agent(Claude Code、Codex、ChatGPT、Cursor、Gemini、opencode 等)的完整对话历史导入为可续聊的 DeepSeek Harness 会话,并支持反向导出回 Claude Code。
SiriLee/dsh-rewind★ 233
同一会话窗口内的 in-place 对话回退(不 fork,Claude Code /rewind 语义):每条消息的 ↶ 按钮把模型上下文回退到任意用户消息,可选用磁盘持久化的 before-backups 还原工作区文件。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。