dsh-edit-turn
在消息行行内编辑用户发言并回滚重跑 适合需要修改历史对话并从该轮重新生成回复,同时保持会话日志不被重写的调试任务。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:DDDMUC/dsh-edit-turn说明文档
阅读完整 README ↗使用
- 把鼠标移到你想改的那条用户消息上,点右侧的编辑图标(铅笔)。
- 消息下方展开编辑器,原文已预填。改完点「保存并重跑」——一次点击即执行:这条消息之后的一切从模型上下文中移除,并立刻重新跑这一轮。
- 编辑器与该轮之后的转录行一起消失,新提示词与新回复出现在下方。
编辑器里如果提示「这条消息包含图片或文件附件」,说明改写只保留文字,附件会被丢弃。
配置
写在 profile 里即可覆盖默认值:
- id: dsh-edit-turn
config:
carrier: 'system/message' # 默认:空 system 节点,模型不可见
markerText: '...' # 仅当 carrier 为 user/message 时使用的标记文本
confirm: true # 默认 true:确认后才执行回退
| 字段 | 默认 | 含义 |
|---|---|---|
carrier | system/message | 替换事件的载体类型。system/message = 空节点,不投影成模型消息;user/message = 短标记文本,会作为一条用户消息进入上下文(等价插件在生产中用的是这种形状,作为兜底)。 |
markerText | 一段说明文字 | carrier: user/message 时的载体文本。 |
confirm | false | 客户端保存后是否先要求一次确认。默认关闭(一次点击即执行:编辑器本身已是用户主动打开的动作,面板里也写明了保存的后果);设为 true 可恢复两步确认。 |
Usage
- Hover the user message you want to change and click the pencil action.
- An editor opens below it with the original text pre-filled. Click "Save and re-run" - one click applies: everything after this message leaves the model context and the turn runs again immediately.
- The editor disappears together with the discarded rows; the new prompt and its reply appear below.
If the editor warns that the message carries attachments, the rewrite keeps the text only and drops them.
Configuration
- id: dsh-edit-turn
config:
carrier: 'system/message' # default: an empty system node, invisible to the model
markerText: '...' # used only when carrier is user/message
confirm: true # default: require a confirmation step
| Field | Default | Meaning |
|---|---|---|
carrier | system/message | Event type carrying the replacement. system/message is an empty dormant node that projects to no model message. user/message is a short marker that does enter the context; an equivalent plugin runs that shape in production, so it is the fallback. |
markerText | an explanatory line | Carrier text when carrier: user/message. |
confirm | false | Whether the client asks for a second confirmation before applying. Off by default - one click applies, because the editor is already an explicit action the user opened and the panel states what saving discards. Set it to true to restore the two-step flow. |