Mongfayi/dsh-recall

用于 DSH Web 界面的消息撤回(撤回)插件:每个用户消息上都有一个撤销按钮,可持久地移除该轮及之后的所有内容,而不会恢复代码更改。

Project Overview项目介绍

dsh-recall is a DSH plugin that removes a user message and everything that follows it from both the conversation UI and the model's visible context, while never rolling back code or file changes. It works by appending a persistent tombstone event that survives restarts, and supports restoring the recalled message's text and images into the input box for editing and resending. Use it when the session is idle to undo an entire turn of Q&A. Note: the recall button is disabled while an agent is running, so the current turn must be stopped first.

dsh-recall 是一款 DSH 撤回插件,可将指定消息及其后续全部对话从界面与模型上下文中移除,但绝不回退代码或文件改动。它通过追加一条持久墓碑事件实现,重启后依然生效,并支持将撤回的用户消息文本与图片整体恢复到输入框以便修改重发。适用于会话空闲时需要撤销某一整轮提问与回复的场景。注意:智能体运行中按钮会被禁用,必须先停止当前回合。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:Mongfayi/dsh-recall

把 Mongfayi/dsh-recall 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-recall

(作者有余额了就继续更新)

对话撤回(recall)插件:把一条消息及其之后的所有内容从对话中移除——界面不再显示、模型不再可见——但绝不回退任何代码/文件改动。撤回通过追加日志(append-only)中的一条持久墓碑事件实现,重启后依然生效。

功能特性

  • 整轮撤回:点击用户消息旁的撤销按钮(复制键左侧),撤回该轮对话及其后的全部内容——你的提问与智能体的回复一并移除;长对话中的子智能体指令、压缩、重试、工作流等也都会被一并撤回。
  • 恢复编辑:撤回后,被撤回用户消息的文本与图片整体恢复到输入框,可修改后重新发送(与 opencode 的撤回行为一致)。
  • 不破坏界面:撤回按钮与框架的复制按钮同一行、互不遮挡;消息气泡、复制键、引用标签、图片画廊全部保持框架原样;含图片的消息始终正常显示图片。
  • 持久且可追溯:撤回记录是一条持久墓碑事件,随会话日志 flush 持久化,重启后依然生效;日志记录一个不删。

使用

  1. 会话空闲时,点击用户消息旁的撤销按钮(复制键左侧);
  2. 确认弹窗后,该轮对话及其后的全部内容被撤回;
  3. 撤回位置显示「已撤回的消息」提示;
  4. 被撤回消息的文本与图片恢复到输入框,可修改后重新发送。

智能体运行中撤销按钮会禁用(先停止当前回合再撤回)。

工作原理

宿主端(lib/index.js)

提供 POST /recall 路由({sessionId, messageId} 或 {sessionId, boundary}),完全基于既有会话协议完成撤回(框架核心没有 Session.recall):

  1. 校验边界:边界必须是当前 surface 上的活跃消息节点(已撤回或被遮蔽 → recall-rejected);
  2. 追加墓碑:追加一条持久墓碑——空内容的 assistant/message,surfaceOp 为 {op:'replace', start: boundary, end} 且 sourceEventSeqs 覆盖全部被遮蔽节点。空内容 assistant 消息不派生任何消息,模型可见历史收缩到 boundary 之前;
  3. 标记与持久化:data.recall = {boundary, end} 标记墓碑(客户端提示节点),随常规 flush 持久化。

错误码:session-not-found / subagent-owned / agent-busy / message-not-found / recall-rejected。

浏览器端(lib/client.js)

  • 撤回按钮:以 priority: -1 覆盖 conversation.chat.node 的 user keyed 渲染器。覆盖项委托给框架自己的用户渲染器(从席位注册中解析原组件;框架渲染器是 react.memo 对象而非普通函数,二者都接受),气泡、复制按键、引用标签与图片画廊全部保持框架原样。撤销按钮定位在框架操作行同一行、复制按键左侧——悬停时钟被抑制使操作行只剩复制键,right:38px 即复制键 28px + 10px 行间距,绝无遮挡。
  • 图片渲染:始终经框架的图片槽 renderMessageImages 渲染(会话授权,标签/灯箱框架原样),不依赖插件自带的画廊加载器——原实现里 loadImage 并不在渲染器 props 中,必然加载失败导致图片不可见。
  • 整轮隐藏:被撤回区间(boundary..end,含端点)内的每一种对话节点都在装配期被隐藏。框架的 slot core 禁止被遮蔽的条目重新声明已被框架条目声明的子槽位,因此不能为每种节点套一个渲染器过滤器;改为在 conversationEvents 上统一包装每个框架对话定义的 buildViewNode:调用原构建器后,只要该行的锚点 seq(anchorSeq / data.seq / data.finalNode.seq / data.closing.finalNode.seq)落在已撤回区间内就返回 null,其余行与框架输出完全一致。这覆盖 steering / context / assistant-step / command / manual-compaction / compaction / model-retry / turn-error / turn-max-tokens / turn-tail / unknown / command-input / tool-call / workflow-run 等全部节点种类。
  • 「已撤回的消息」提示:recall 定义匹配墓碑事件(assistant/message + data.recall)注册提示节点。
  • 实时更新:墓碑到达实时会话后,通过重新注册本插件的 recall 定义触发一次会话装配重建,被撤回行立即消失(无需刷新页面)。
  • 恢复输入框:文本经 conversation.input.for(scope).setDraft() 写回;图片经会话远程 sessions.binding(sessionId).session.readAttachment() 取回字节 → conversation.createDraftImages() 注册为草稿图片,addImages() 挂到图片轨道。被撤回附件仍保留在 append-only 日志中,恢复有真实数据源;单张失败不影响其余恢复,也绝不回滚已完成的撤回。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-policy-drift-proof 下一个 Next furina-desk-pet →