DSH Hub

Taler97/dsh-rollback

dsh-rollback

BundleWorkflow0 GitHub stars· updated 2026-08-17

File-mutation rollback plugin for DeepSeek Harness

Install

npx @deepseek-ai/dsh plugin --profile demo add dsh-rollback

Restart `dsh web` after install. Bundle APIs can change during the developer preview.

README badge

dsh-rollback DSH Hub badge
[![DSH Hub](https://dshhub.dev/badge/dsh-rollback.svg)](https://dshhub.dev/plugins/dsh-rollback)

Paste this into your README. The star count updates with every catalog sync.

From the README

Excerpt from Taler97/dsh-rollback, cleaned of badges and images.

dsh-rollback

English | 中文

File-mutation rollback plugin for DeepSeek Harness: it observes every successful tool result for the pre-image a write/edit mutation reports, checkpoints that pre-image into the workspace git object database or a snapshot store, and exposes restore through a model-facing rollback_files tool and a /rollback human command. It registers no service and changes no loop code — capture rides the tools/result observation event, and restore writes files directly (never through the fs policy seam or the sandbox, because undoing a mutation must not be gated by the policy the mutation passed).

Install

The package is an installable bundle (declares dsh.bundle), so it plugs into a profile without touching the harness. All you need is a dsh CLI; the runtime peer packages (@deepseek-ai/dsh-tools, @deepseek-ai/cordis, ...) resolve from the dsh installation itself, so nothing else is installed.

Prerequisites

  • A dsh CLI on the machine (dsh plugin shells out to pnpm, so pnpm must be on PATH).
  • A profile to install into — demo below is initialized on first use; use any name.

Install from npm (recommended)

dsh plugin --profile demo add dsh-rollback

Other sources work the same way:

# straight from git (sources are built by the prepare script; pin a commit)
dsh plugin --profile demo add github:you/dsh-rollback#<sha>

# or from a local tarball
dsh plugin --profile demo add ./dsh-rollback-0.1.0.tgz

Verify the install

  1. The profile manifest under $DSH_HOME/profiles/demo/ ($DSH_HOME defaults to ~/.dsh) now lists dsh-rollback in dependencies and in dsh.profile.bundles — the reconciler adds it automatically because the package declares dsh.bundle. The equivalent manual patch layer row:
- id: rollback
  name: dsh-rollback
  config:
    mode: auto          # auto | git | snapshot
    storeDir: ''        # '' = <harness home>/rollback
    maxRecords: 200
    gitPath: git
  1. Start a session. Any of these proves the plugin is live:
    • the model sees a rollback_files tool in its tool list,
    • typing /rollback answers rollback: nothing to restore (instead of an unknown-command error) before any mutation happened.

Usage

30-second quickstart

  1. Open a session whose working directory is a git repository.
  2. write a file notes.md with the content hello.
  3. write it again with goodbye — the first content is silently checkpointed.
  4. Tell the model "restore the file you just overwrote" (it calls rollback_files), or type /rollback yourself.
  5. Read notes.md: it says hello again.

For humans — /rollback [count]

Type it in the chat input (base web and headless profiles mount the command registry the command needs):

  • /rollback — undo the single most recent captured mutation in this session's working directory,
  • /rollback 3 — undo the three most recent ones.

The output lists every restored file and its action:

rollback: restored 2 file mutation(s):
  restored  /ws/src/lib/parse.ts
  deleted   /ws/src/lib/generated.ts

For models — rollback_files

Related plugins