Preface¶
In DSH development and usage scenarios, reverting conversations, fine-tuning prompts, and undoing file changes are frequent requirements. Traditional approaches often rely on memorized commands or manual operations and lack an intuitive graphical entry point. The dsh-revert plugin provides DSH with a modernized conversation rollback and retry solution through graphical interaction and a dual-engine snapshot mechanism.
Plugin Positioning¶
dsh-revert is a client-side plugin developed by Movingtoleveltwo. It uses pure UI graphical interaction, supports in-place prompt fine-tuning, and implements safe snapshot restoration for workspace and external files through ShadowGit and external file interception techniques.
Core Features¶
- Pure UI graphical interaction
- In-place Prompt fine-tuning
- Workspace snapshots
- Safe restoration outside the workspace
- Full multi-endpoint compatibility
Installation and Enablement¶
The installation commands are as follows:
cd ~/.dsh/profiles/web
npm link /path/to/dsh-revert
After installation, add "dsh-revert" to the dsh.profile.bundles field in ~/.dsh/profiles/web/package.json, and restart DSH for the changes to take effect.
Typical Usage¶
- Revert Retry: Hover below any chat message and click the “Revert Retry” button.
- Prompt Fine-tuning: A dialog directly displays the user’s Prompt for that turn. After modifications, the cursor automatically focuses back into the dialog, and the modified content is backfilled into the chat input box.
Technical Principles¶
The plugin injects conversation.chat.assistant-actions through DSH’s Cordis slot system and renders action buttons and dialogs on the client side. The Host exposes a lightweight snapshot and rollback scheduling service through /dsh-revert/rpc. The snapshot storage engine consists of two parts: ShadowGit maintains isolated bare repository snapshots based on the hash of the workspace path, while ExternalFileTracker maintains turn-level pre-records of external file modifications.
Applicable Scenarios and Notes¶
The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license before installation.
Summary¶
dsh-revert simplifies the conversation rollback process through a graphical interface, while using the dual-engine snapshot mechanism to ensure safe restoration of file states. It is suitable for users who frequently perform conversation debugging and code rollback in DSH.