dyhyfjn/dsh-rollback-withdraw
Trae风格的DeepSeek Harness Web撤回功能——一键回滚工作区代码与对话(通过git提交或硬链接快照)。会话撤回插件。
项目介绍Project Overview
dsh-rollback-withdraw 是 DSH Web 插件,在每条消息旁加撤回按钮,可把工作区代码和会话(记忆、轨迹、目标)一起回退到该消息之前;用 git 提交或硬链接快照做检查点,适合想撤销某轮对话及其改动时。注意:仅支持 Windows,git 模式会 reset --hard 并清理未跟踪文件,且只能按轮次边界回退。
dsh-rollback-withdraw is a DSH web plugin that adds an undo button to each message, rewinding both workspace code and the conversation—memory, trajectory, goals—to before that turn. It checkpoints via git commits or hard-link snapshots, forking the session on rollback. Use it to discard an exchange and its file changes. Caveat: Windows-only; git mode runs reset --hard plus clean, and rollback only works at turn boundaries.
请帮我了解并安装插件:【dsh-rollback-withdraw】【https://github.com/dyhyfjn/dsh-rollback-withdraw】
把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.
或使用命令行安装(适合开发者)Or use CLI install (for developers)
命令行安装CLI Install
dsh plugin --profile web add dsh-rollback-withdraw
把 dyhyfjn/dsh-rollback-withdraw 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-rollback-withdraw
Trae-style withdraw for DeepSeek Harness Web. A one-click rollback button on every user question and assistant answer that rewinds both the workspace code and the conversation itself (memory, trajectory, goals) to the state before that message.
What it does
Every completed turn in a DSH web session becomes a rollback point. Click the undo icon next to any message and the workspace files are restored to the last completed turn before it, while the session is forked at that point and the rolled-back conversation opens automatically — exactly as if that exchange never happened.
- Workspace code — restored via the best available backend (see below).
- Conversation — the session is forked at the boundary and the child (rolled-back) session is opened; model memory, trajectory, goals and subagent lineage all match that point in time.
- First-class git integration — when the workspace is a git repository, checkpoints are real commits, and a withdraw is a
git reset --hard+ a safegit clean.
Features
- Withdraw on every message — under every user bubble and on the final assistant message of each completed turn.
- Two restore backends, chosen automatically:
- Git mode (default on, one-click toggle): every turn end is committed as
rollback checkpoint <seq>; a withdraw restores viagit reset --hard+git cleanthat preserves dependency/build directories. Space-efficient and aligned with normal git workflows. - File-snapshot mode: otherwise, hard-link snapshots are taken at every turn end — unchanged files share a single copy across snapshots, so keeping hundreds of turns costs almost nothing.
- Git mode (default on, one-click toggle): every turn end is committed as
- Per-workspace toggle — the git-branch icon in the session header turns git auto-commit on/off; the choice persists in
.dsh-rollback/config.json. - Loads automatically — packaged as a web-profile bundle (
dsh.bundle+dsh.client), it starts with the client; no re-activation after restarts. - Two-step confirm — click once to arm (button turns red), click again to execute, so a rollback is never accidental.
Requirements
| Item | Notes |
|---|---|
| OS | Windows (uses robocopy + PowerShell 5.1+); other platforms planned |
| Git | optional — only needed for git mode |
| DSH | web profile (dsh web) |
Installation
# from npm
dsh plugin --profile web add dsh-rollback-withdraw
# or from this repository
dsh plugin --profile web add github:dyhyfjn/dsh-rollback-withdraw
# or a local build
npm pack && dsh plugin --profile web add ./dsh-rollback-withdraw-0.1.0.tgz
Restart the web app afterwards — plugin-set changes take effect on restart.
Usage
- Chat with the agent as usual; a rollback point is recorded automatically after every completed turn.
- Hover a message and click the undo icon — click once to arm ("confirm"), click again to execute.
- The workspace is restored and the UI switches to the forked, rolled-back session. Continue from there.
The git-branch icon in the session header shows git-mode status:
- lit (brand color + green dot) = git auto-commit on;
- dimmed = off, or the workspace is not a git repository (tooltip explains);
- disabled when the workspace has no git repo.
How it works
- The host half listens to
session/eventand records a checkpoint at everyturn/end— a git commit, or a hard-link snapshot under<workspace>/.dsh-rollback/snap/<session>/<seq>/. - Client buttons talk to the host through a same-origin HTTP route
/rollback/rpc(the static-plugin channel that replaces the dynamicharness.handle). - A withdraw validates the boundary (the last
turn/endbefore the message), restores the files, then the client forks the session at that sequence and opens the child. - The first message of a session cannot be withdrawn (there is no prior turn); messages from before the plugin was installed have no snapshot — the button explains why.
Configuration
| Key | Where | Default | Meaning |
|---|---|---|---|
gitAutoCommit |
<workspace>/.dsh-rollback/config.json |
true |
use git commits as rollback points when the workspace is a git repo |
Ignored paths (never snapshotted, committed, or deleted): node_modules, .git, dist, build, .next, .venv, __pycache__, .idea, .vscode, coverage, *.pyc, *.log, … (see IGNORE_DIRS / IGNORE_FILES in lib/index.js).
Security note
/rollback/rpc is a same-origin, unauthenticated route on the localhost web server — this tool assumes personal, localhost-only usage. Do not expose the harness port to untrusted networks.
Limitations
- Windows first (robocopy + PowerShell); macOS/Linux fallbacks are planned.
- Git mode performs a whole-repository
git reset --hard+git clean(ignored directories preserved) — untracked non-ignored files are deleted on rollback. - Withdrawing an assistant answer also rewinds the preceding question (rollback returns to the last completed turn end); the platform's fork primitive only cuts at turn boundaries.
- The source session stays in the sidebar as a branch; there is no auto-archive.
Development
npm pack # produce the publishable tarball
node --check lib/index.js lib/client.js # syntax gate
License
MIT — see LICENSE.
nexu-io/open-design
freestylefly/awesome-gpt-image-2
anywhere-labs/dsh-desktop
walkinglabs/learn-harness-engineering
awesome-dsh-plugin/awesome-dsh-plugin
MemTensor/MemOS