MathieuPortmann/dsh-history-edit ↗★ 0
dsh-history-edit
提供对话历史编辑、撤回与重新运行功能 适合需要频繁修改历史提问、撤回消息或修正AI回复的对话调试场景。
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:MathieuPortmann/dsh-history-edit说明文档
阅读完整 README ↗dsh-history-edit
Conversation history edits for DeepSeek Harness (DSH): change what you said, go back to an earlier point, or fix an AI reply, without losing anything.
Maintenance: best-effort. Issues may go unanswered; forks are welcome.
What it adds to the chat
- Recall (under each of your messages). Goes back to just before that message and puts its text back in the message box, to resend as is, changed, or with files. Nothing is deleted: when you send the next message, the recalled message and everything after it are set aside.
- Edit again (on a message that was edited through the
rewritemethod of the channel below). Opens an edit window; the edited message replaces the old one and the AI answers again. If later messages of yours exist, a copy of the conversation is created instead, so nothing is lost, and the page opens it. - Go back here (under an AI reply that has later turns). The next message you send restarts from that reply and the later turns are set aside. A banner says so and has a Cancel button.
- Edit reply (under an AI reply). Creates a copy of the conversation up to that turn with the reply text changed; the original stays as it was, and the page opens the copy.
"Set aside" means hidden from the AI and from the chat page. The events stay in the session log.
The interface is in English, and in French when the page language is French. To add a language,
add a table to STRINGS at the top of client.js (missing keys fall back to English).
Install
dsh plugin --profile web add github:MathieuPortmann/dsh-history-edit
Restart the profile afterwards. Requires Node ^22.19.0 || >=24 and DSH >=0.2.0-rc.2 (list, rewrite, rewind,
cancelRewind, editReply, canEdit), protected by DSH's own connection check (Host/Origin
fence and browser token).
client.js(page side) draws the buttons, the edit window and the banner, and hides the turns that were set aside. It finds the chat rows through thedata-chat-flow-kind,data-chat-anchor-keyanddata-chat-turnattributes of DSH's chat page.
Compatibility
| Component | Supported |
|---|---|
| Node.js | ^22.19.0 || >=24.0.0 (engines.node) |
| DSH | >=0.2.0-rc.2 for the page, behind ctx.connection.admit() (DSH's Host/Origin fence and token); bodies are limited to 1 MiB and must be JSON |
| Dynamic module loading | index.js (importFromDsh) |
| Hook on the agent loop | index.js (agent/pre-step) |
The plugin adds no tool for the model and no setting.
Verification
Checked on a disposable profile (DSH_HOME pointing at a temporary folder, profile cloned with
dsh --from-default-profile web, so the real profile is never touched):
npm pack
dsh plugin --profile t add file:$PWD/dsh-history-edit-0.1.0.tgz # install
dsh --profile t --no-open --port 3095 # start: plugin loads, no error
dsh plugin --profile t remove dsh-history-edit # uninstall
npm test runs 24 standalone tests of lib/history.js (turn outline, edit plans, go-back ranges,
reply cuts, edited replies, contiguity errors) with no DSH installation needed. The module is a
JavaScript port of the logic that first ran in a native addon; the port was compared with that
addon on about 2.2 million generated and real-log cases with identical results.
Develop
npm test
License
MIT