dsh-undo: Persistent Undo/Redo per User Turn for DeepSeek Harness

Foreword

In the plugin ecosystem of DSH (DeepSeek Harness), developers can extend Host behavior, commands, and WebUI behavior through plugins. The community directory is an independent site with no official affiliation to DeepSeek / High-Flyer, and it should not be described as an official app store.

For developers using dsh for multi-step tool tasks, a specific issue arises: the model advances the conversation based on real user messages, and tools may also modify workspace files during a given turn. If a rollback is needed after a certain turn, simply deleting visible text is often insufficient—you also need to restore the visible surface and workspace files to the corresponding boundary. dsh-undo provides undo/redo capabilities specifically for this boundary.

What This Is

dsh-undo is a persistent multi-step context undo/redo plugin for DeepSeek Harness (dsh). It rolls back the visible surface based on real user messages and restores workspace files modified by tools during the selected user turns.

Repository clues point to LingLambda, licensed under MIT, with package.json showing version 0.3.0-preview.1. The maintainer attribution in verified materials is ambiguous: the GitHub path and homepage clues both point to LingLambda, but no explicit maintainer designation is provided.

Important limitation: this release is a forward-looking preview and is not currently compatible with any released version of DeepSeek Harness. It depends on unreleased Harness support for durable surface/rewind / surface/restore events and the conversation.chat.user-actions WebUI slot. If installed in its current state, /undo will fail closed with an upgrade notification.

Core Features

Local Undo and Redo Commands

The plugin provides local commands that are not sent to the model:

  • /undo: Rolls back the latest visible real user message and all subsequent surface messages.
  • /undo <user-seq>: Rolls back from the specified visible user message, including all subsequent turns.
  • /redo: Restores the most recent active rollback. Repeated undo/redo operations use LIFO order.

Session Replay and Persistence

The plugin implements undo/redo by appending durable surface/rewind and surface/restore control events rather than replacing original messages. It preserves original message nodes, message IDs, tool-call associations, and log events.

Session replay can reconstruct the same visible surface and redo stack.

New regular surface output invalidates the active redo history.

Workspace File Restoration

The plugin records the workspace tree before and after tool execution in an isolated hidden Git directory:

~/.dsh/dsh-undo/snapshots/

It does not create commits, switch branches, or modify the repository’s own Git index.

File restoration scope is:

  • Limited to files touched by tools during the selected user turns;
  • Supports tracked files and untracked files up to 2 MiB;
  • Restricted to within the detected Git workspace root, never restoring files outside the root.

patch and redo metadata are stored per session, allowing file redo to persist across Host restarts. A two-phase log coordinates interrupted file operations after restart.

WebUI Actions

The WebUI client provides an undo action on confirmed real user message bubbles. Clicking it invokes /undo <user-seq>; the Host validates that the target remains a legitimate rollback point.

Background Task Handling

The plugin associates background jobs returned by top-level tools with their user turn. Undo requests terminate jobs launched by the removed turns.

Note the following boundaries:

  • Background jobs dispatched via nested tool calls or subagents may not be associated with the root user turn.
  • Undo only sends termination signals to top-level background jobs and does not wait indefinitely for process exit.

Installation and Enablement

First, be aware of the current release status: it depends on unreleased Harness capabilities, and installing it today will cause /undo to fail closed with an upgrade notification. If you are only previewing for future integration coordination, you can install it using the npm example provided in verified materials:

dsh plugin --profile demo add dsh-undo

Only the npm example from verified materials is used here; the materials also contain an original git installation instruction, but no single official installation command is specified. The plugin runs with the current dsh process privileges, so you should review the source code and license before installation.

Typical Usage

Basic commands:

/undo
/undo 42
/redo

Usage:

  1. /undo rolls back the latest real user turn.

  2. /undo 42 rolls back from the specified user-seq, including all subsequent turns.

  3. /redo restores the most recent active rollback.

  4. In the WebUI, you can also click the undo action on an older user message bubble, which invokes /undo <user-seq>.

Suitable Scenarios and Considerations

Consider using this plugin when:

  • You use dsh for multi-turn tool tasks and want to roll back the conversation surface at real user message boundaries.
  • You want to restore workspace files modified by tools in the rolled-back turns.
  • You want to perform rollbacks on confirmed real user message bubbles in the WebUI.

Things to note:

  1. The current release is not compatible with any released version of DeepSeek Harness; older Harness versions will fail closed, prompting for a compatible Harness upgrade, rather than writing replacement assistant messages or duplicating transcript events.

  2. Network requests, database writes, remote API calls, exited processes, and other external effects cannot be undone.

  3. File restoration only covers files within the detected Git workspace root, and untracked files are limited to 2 MiB or less.

  4. Background job association and termination apply only to tasks returned by top-level tools, and the plugin does not wait indefinitely for process exit.

  5. New regular surface output invalidates the active redo history.

  6. The plugin runs with the current dsh process privileges; review the source code and license before installation.

Conclusion

The value of dsh-undo lies in anchoring “undo” to real user turns: it both rolls back DSH’s visible surface and attempts to restore workspace files modified by tools during those turns. Current materials indicate it is still in preview and requires a matching Harness release; check version compatibility and permission boundaries before installation.

Directory page (from plugin clues, not confirmed from crawled materials): https://www.skillhub.cn/plugins/LingLambda/dsh-undo
GitHub: https://github.com/LingLambda/dsh-undo

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye