When developing agents in DeepSeek Harness (DSH), code or file content generated by the model often needs to be rolled back. Manually deleting messages and restoring files is inefficient and can easily lead to state inconsistencies. The dsh-rollback plugin provides synchronized rollback for conversation history and file state.
dsh-rollback is a TRAE-style rollback plugin for DSH Web, maintained by domitor-syh. It implements aligned rollback of conversation state and file state, using a checkpoint mechanism to restore the model context and workspace files simultaneously to the state before the specified turn was initiated.
Core Features¶
- Turn-level checkpoints: A checkpoint is created before each turn is initiated.
- 10-turn sliding window: Only checkpoints for the most recent 10 turns are retained.
- File rollback: Restores original content of modified files, recovers deleted files, and removes newly created files.
- In-place truncation: Keeps the session ID unchanged and truncates the conversation history in place.
- Web rollback button: Provides a visual operation entry point.
- Manual command trigger: Supports command-line operations.
- Affected file list: Previews file changes before rollback.
Installation and Enablement¶
Install using the official command:
dsh plugin --profile web add @domitor-syh/dsh-rollback
After installation, restart dsh web.
Typical Usage¶
- Web: Click the “Rollback” button under each reply.
- Command line:
/rollback list: Lists the turns that can be rolled back./rollback preview <n>: Previews the rollback effect./rollback <n>: Executes the rollback.
Use Cases and Notes¶
It is suitable for agent development scenarios that require frequent resets of session state.
- Version requirement: DSH >= 0.1.1-rc.2 is required (tested with 0.1.5-rc.2).
- Compatibility warning: Incompatible with installing 0.1.0-0.2.2 on 0.1.5.
- Runtime restriction: Rollback is prohibited for a running turn.
- Error handling: If the plugin encounters an error, it fails loudly (prints to the console) instead of failing silently.
- File system: Special handling includes fallback writes to the disk root and cleanup of empty directories.
This plugin simplifies the rollback process by providing unified state management. For the source code and license, please refer to GitHub.