When developing or debugging agents with DeepSeek Harness (DSH), you often run into scenarios where you need to undo the previous step: for example, a code change was wrong or the conversation logic took a wrong turn. Manually deleting messages and restoring code is not only tedious but also error-prone. Here is a plugin that solves this pain point.
What Is This¶
dsh-plugin-session-rollback is a plugin maintained by antlordGit that provides session and workspace code rollback synchronization for DSH. Its core value is binding the deletion of conversation records to the restoration of code state, ensuring that the two remain consistent.
Core Features¶
- Automatically creates a workspace code checkpoint for each real human question.
- Provides an “Undo” action next to the copy button on user messages.
- Synchronously rolls back the chat records on the current page and the workspace code.
- Removes the target question and all subsequent questions and answers.
- Automatically backs up the current workspace before rollback.
- Supports using
/rollback-undoto undo the most recent code rollback. - Snapshots use SHA-256 content-addressed storage.
- Automatically adapts to DSH’s light and dark themes.
Installation and Activation¶
The installation method is as follows:
dsh plugin --profile web add github:antlordGit/dsh-plugin-session-rollback
After installation, you need to restart DSH Web:
dsh web
Typical Usage¶
After installing the plugin and restarting it, chat with the assistant normally. In the chat interface, click the “Undo” button next to the copy button below a user message and confirm the rollback scope. The page removes that question and all subsequent questions and answers, while restoring the workspace code to the state before that question was committed.
The code before rollback is backed up automatically. If you need to undo the most recent code rollback, run the following command in the input box:
/rollback-undo
Applicable Scenarios and Notes¶
- Applicable scenarios: Suitable for developers who need to repeatedly debug code, verify logic, and roll back to specific question checkpoints during conversations.
- Notes:
- Messages created before the plugin was installed or enabled usually do not have code checkpoints, so their code cannot be rolled back safely.
- Only real human messages with
source.kind === 'user'create checkpoints; messages generated by plugins, models, or tools do not. - A running session cannot be rolled back. Stop it first or wait for the current answer to finish.
- Excluded directories, oversized files (16MB), symbolic links, and special files are not rolled back with the code.
/rollback-undorestores the most recent automatic backup and affects code; it does not redisplay chat records that have already been hidden from the current Surface.
Short Closing¶
This plugin achieves atomic rollback of conversation and code through automatic snapshots and content-addressed storage. See the detailed documentation and source code on GitHub.