LingLambda/dsh-undo

Context undo/redo plugin for DeepSeek Harness (dsh): roll the model context back to the last completed step an

Durable, multi-level undo/redo for DeepSeek Harness that rewinds model context by real user turn and restores the workspace files changed by tools in that turn. The commands are handled locally and never sent to the model: /undo rewinds the latest visible real user message and everything after it, /undo <user-seq> rewinds from a specific user message including all later turns, and /redo restores the latest active rewind with LIFO order for repeated operations. Sessions stay append-only — undo appends a surface/rewind control event and redo a surface/restore event, retaining message nodes, ids, tool-call correlations and log events so replay reconstructs the same visible surface. Before and after each top-level tool execution the plugin records a workspace tree in an isolated hidden Git directory under ~/.dsh/dsh-undo/snapshots/ without creating commits or touching the repository's own index, and a two-phase journal reconciles interrupted file operations after a restart.

Agent Capabilities ★ 4 updated 2026-08-15 ✅ runtime-tested
View on GitHub ↗

Install

dsh plugin --profile demo add dsh-undo

README install (the package is a dsh bundle whose dsh.bundle points at cordis.patch.yml): from npm, dsh plugin --profile demo add dsh-undo; from git, dsh plugin --profile demo add github:LingLambda/dsh-undo#<sha> — the prepare script builds lib/, so authorize the build in the profile's pnpm-workspace.yaml first. Local development against a harness checkout uses an overlay (pnpm dsh web --patch ./cordis.patch.yml --patch /absolute/path/to/dsh-undo/overlay.yml with an insert row pointing at src/index.ts). npm dsh-undo 0.2.0 verified 2026-09-12 (registry repository field → github.com/LingLambda/dsh-undo). IMPORTANT: the README carries a warning that this release is not usable with any currently published DeepSeek Harness version — it depends on unreleased durable surface/rewind / surface/restore events and the conversation.chat.user-actions WebUI slot, so installing it today makes /undo fail closed with an upgrade message. It is published to preview and coordinate a future integration.

Compatibility

Needs a Harness version supporting durable surface/rewind and surface/restore session events plus the conversation.chat.user-actions client slot. Older releases fail closed: /undo reports that a compatible harness upgrade is required instead of writing replacement messages. File restoration needs a Git workspace.

Details

Recent updates

The README lists the limits explicitly: file restoration is confined to the detected Git workspace root; network requests, database writes, remote API calls and already-exited processes cannot be undone; background jobs started through nested tool dispatches or child agents may not be tied to the root user turn; undo does not wait indefinitely for process exit; and new ordinary surface output invalidates active redo history. Files ignored by the repository and untracked files over 2 MiB are left untouched.

FAQ

How do I install dsh-undo?
From npm: dsh plugin --profile demo add dsh-undo. From git: dsh plugin --profile demo add github:LingLambda/dsh-undo#<sha>, authorizing the build in the profile's pnpm-workspace.yaml first because the prepare script compiles lib/.
Does /undo send anything to the model?
No — the README states the commands are handled locally and never sent to the model. Undo appends a surface/rewind control event and redo a surface/restore event to the append-only session.
Can I use it today?
Not yet. The README warns this release is not usable with any currently published DeepSeek Harness version because it needs unreleased durable surface/rewind/surface/restore events and the conversation.chat.user-actions client slot; installing it now makes /undo fail closed with an upgrade message.

More plugins in Agent Capabilities

Browse more in Agent Capabilities

Guides for Agent Capabilities plugins