DeepSeek Harness plugin

dsh-rewind-xsjustc

Rewind a DSH conversation to any user message: hide the tail from the chat view and the model context, keep the durable log intact, cancel freely before sending.

Jump to install

Source facts

Repository
XSJUSTC/dsh-rewind
Latest update
Aug 18, 2026
Category
Memory
GitHub stars
4
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/XSJUSTC/dsh-rewind
Plugin: dsh-rewind-xsjustc
Author: XSJUSTC

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer4 files
README_EN.mdSource · read only
README language

@xsj/dsh-rewind

English | 简体中文

A conversation-rewind plugin for DSH (DeepSeek Harness). A permanent bundle plugin with a host half and a web client half — zero dependencies, zero build steps.

Features

![Rewind action preview](screenshot.png)

  • Every user message row gains a ↺ rewind action beside the copy icon.

Clicking it: - interrupts the current turn if the model is still thinking/streaming; - hides that message and everything after it from the chat view (as if the tail never happened); - pre-fills the composer with the message text — unsent and editable; - on the next send, the model only sees the truncated history (everything before the rewind point) plus your new message.

  • While a rewind is pending:

- a banner above the composer explains the state; - a ✕ "cancel rewind" button sits left of the send button — clicking it restores the hidden messages, keeps your draft, and sends nothing.

  • Once sent (rewind committed), the hidden tail never reappears in the chat

view and never enters the model context again.

  • Only user messages can be rewound; assistant messages have no rewind entry

(the host validates the event type).

Log & recovery

  • The session log (an append-only event stream) never loses a message.
  • Every state change appends a hook/invoked event with payload

{ source: 'xsj.rewind', phase: 'mark' | 'cancel' | 'commit', targetSeq, hiddenFrom?, hiddenTo?, preview? }.

The type is a known-but-unused reserved entry in this build, so the records are reload-safe.

  • After a process restart, opening a session replays these records to rebuild

the hidden ranges — model-side and UI-side hiding stay consistent across restarts.

  • The trajectory view does not render this reserved event type; audit the raw

session JSONL log directly.

Install

# from anywhere; the path points at your clone of this repo:
dsh plugin --profile web add <absolute path to this repo>

# restart the DSH process, then refresh the browser page

The command registers the package into the profile (~/.dsh/profiles/<name>/package.json: dependencies + dsh.profile.bundles). At boot the profile merges this package's cordis.patch.yml, inserting the host plugin row; the web client scan then serves lib/client.js automatically.

Uninstall

dsh plugin --profile web remove @xsj/dsh-rewind
# restart DSH. Rewind records in session logs are harmless (hook/invoked is a
# known event type).

How it works

  • Model-side truncation: patches the live Session object's

deriveMessages() to skip hidden surface ranges (memoized by a signature of surface size / range count / replace generation). The request builder, the llm/stream reconstruction invariant, and the image check all share this one method, so every reader stays consistent. No message event is ever added, removed, or rewritten.

  • Interrupt: on mark, a running agent is cancelled with

agent.cancel({ kind: 'user' }, { keepInbox: true }); queued messages survive and continue from the rewind point.

  • Commit point: inside the agent/pre-step waterfall, the first step that

claims a real input message seals the hidden range [targetSeq, current log end]; the new message is appended afterwards and stays visible.

  • UI hiding: chat rows carry data-chat-flow-key; the plugin maintains one

dynamic display:none rule set for the hidden keys. Cancelling or switching sessions restores everything without touching any shipped renderer.

  • Rewind icon: takes over the user/steering cells of

conversation.chat.node at priority -1 (the slot system's native shadowing), replicating the native bubble (MessageText / ImageGallery / Tooltip / writeClipboard) plus the ↺ button.

Porting

The plugin has no npm dependencies: the host half uses only Node builtins and injected services; the client half pulls react, @deepseek-ai/dsh-client-ui-primitives, and @deepseek-ai/dsh-client-ui-attachment from the shell's frozen module table via window.__ModuleLoader__. Clone this repo on any machine and follow "Install".

License

[MIT](./LICENSE)