跳到正文

LingLambda/dsh-undo

42最近提交 2026年8月15日

dsh-undo DSH 插件

dsh-undo 提供撤销/重做命令,按真实用户轮次回退模型上下文,并恢复该轮次中工具修改的工作区文件。命令在本地处理,不会发送给模型。它使用持久化会话事件来确保重启后撤销/重做仍然有效。

如何安装 dsh-undo DSH 插件

dsh plugin --profile demo add dsh-undo

复制不会执行命令。安装 dsh-undo DSH 插件前请核对仓库和版本。

dsh-undo DSH 插件数据来源

dsh-undo DSH 插件快照日期:2026年8月16日

discovered

dsh-undo DSH 插件能做什么

  • /undo 回退最新的可见用户消息及其之后的所有表面消息。
  • /undo <user-seq> 从指定的可见用户消息开始回退,包括之后的所有轮次。
  • /redo 恢复最新的活跃撤销;多次撤销/重做使用后进先出顺序。
  • WebUI 客户端在已完成的用户消息气泡上添加撤销操作。
  • 在工具执行前后使用隐藏的 Git 目录记录工作区文件,仅恢复选中轮次中工具涉及的文件。
  • 撤销的轮次中启动的后台任务会请求终止。

dsh-undo DSH 插件适合哪些场景

  • 撤销误发的用户消息及模型的回复。
  • 恢复之前轮次中工具修改的工作区文件。
  • 撤销后重新执行撤销,回到之前的状态。
  • 使用 WebUI 操作快速撤销特定的用户轮次。
  • 从工具对文件造成的不必要更改中恢复。

dsh-undo DSH 插件适合谁

  • 需要撤销模型交互和工具变更的 DeepSeek Harness 用户。
  • 在基于 Harness 的应用中集成多级撤销/重做功能的开发者。

dsh-undo DSH 插件的限制

  • 文件恢复仅限于检测到的 Git 工作区,不会恢复工作区根目录之外的文件。
  • 网络请求、数据库写入、远程 API 调用以及已退出的进程无法撤销。
  • 通过嵌套工具调度或子代理启动的后台任务可能无法关联到根用户轮次。
  • 新的普通表面输出会使活跃的重做历史失效。
  • 需要支持持久化 surface/rewind 和 surface/restore 事件以及 conversation.chat.user-actions 插槽的 Harness 版本。

dsh-undo DSH 插件的仓库 README 摘录

以下文字摘自 dsh-undo DSH 插件的上游仓库 LingLambda/dsh-undo 的 README,版权归原作者,仅作引用。

English | [中文](README.zh.md) > [!WARNING] > **Forward-looking preview: this release is not usable with any currently published DeepSeek Harness version.** It depends on unreleased Harness support for durable `surface/rewind` / `surface/restore` events and the `conversation.chat.user-actions` WebUI slot. Installing it today will make `/undo` fail closed with an upgrade message. Publish this package only to preview and coordinate the future integration; do not present it as production-ready until the matching Harness release exists. look for <https://github.com/deepseek-ai/deepseek-harness/discussions/467/> Durable, multi-level undo/redo for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh`). It rewinds model context by real user turn and restores workspace files changed by tools in that turn. The commands are handled locally and are never sent to the model: - **`/undo`** rewinds the latest visible real user message and every surface message after it. - **`/undo <user-seq>`** rewinds from a specific visible user message, including all later turns. - **`/redo`** restores the latest active rewind. Repeated undo and redo operations use LIFO order. The WebUI

阅读完整 README仓库许可: MIT

dsh-undo DSH 插件常见问题

如何安装 dsh-undo?

你可以通过 npm 安装:运行 `dsh plugin --profile demo add dsh-undo`。或者从 git 安装:`dsh plugin --profile demo add github:LingLambda/dsh-undo#<sha>`。确保你的 Harness 版本支持所需的事件和插槽。

如何使用撤销命令?

使用 `/undo` 撤销最新的用户轮次。使用 `/undo <user-seq>` 从指定用户消息开始撤销。使用 `/redo` 恢复最近的撤销。命令在聊天中输入,并在本地处理。

dsh-undo 能恢复工具修改的文件吗?

可以。它会在每个顶级工具执行前后使用隐藏的 Git 目录记录工作区树。撤销只恢复选中用户轮次中工具触及的文件。重做会恢复撤销前的树。文件恢复仅限于检测到的 Git 工作区。

如果撤销了启动后台任务的操作,会怎样?

后台任务会与启动它的用户轮次关联。撤销会请求终止该轮次中启动的任务。重做会恢复上下文和文件,但无法重新启动已终止的进程。

该插件对 Harness 版本有什么要求?

该插件需要 Harness 版本支持持久化的 `surface/rewind` 和 `surface/restore` 会话事件,以及 `conversation.chat.user-actions` 客户端插槽。旧版 Harness 会失败关闭并提示升级。