dsh-sqy-rewind: Rewind a DSH session to a specified turn

Introduction

During the use of DeepSeek Harness (DSH), you may sometimes need to undo an already-sent turn of a conversation without restarting the entire session or clearing the history. The dsh-sqy-rewind plugin provides the ability to rewind the current session to the point before a user initiated a given turn.

What It Is

dsh-sqy-rewind is a DeepSeek Harness plugin maintained by LUDIWUSI12138. It focuses on solving the session rewind problem and belongs to the “memory” category of plugins.

Core Features

The plugin mainly provides the following capabilities:
1. Session rewind: Rewinds the current session to before a specific turn was initiated.
2. Model masking: Uses surface replace to mask the history in place, so that, from the model’s perspective, that turn never happened.
3. UI synchronization: The plugin automatically hides the rewound turn from the interface.
4. Log retention: Does not modify the DSH core source code, and no original logs are deleted.
5. Per-turn operation: Supports hiding DOM nodes by turn number.
6. Dependency projection: Depends on the turnOutline projection.
7. Automatic stopping: The rewind operation first stops the currently running turn.

Installation and Activation

The plugin is installed via the command line. After installation, you must restart DSH for it to take effect.

Installation Command

dsh plugin --profile desktop add github:LUDIWUSI12138/dsh-sqy-rewind

Verifying Installation

After restarting DSH and opening a session, you should be able to see a rewind icon next to the “Copy” icon under each user message.

Usage

Marketplace Installation

Search for dsh-sqy-rewind in the DSH plugin marketplace to install it with one click.

CLI Installation

Use the command-line installation method described above.

API Invocation

Invoke the rewind operation via the API:

POST /plugins/dsh-sqy-rewind/api/rewind

Body:

{
  "sessionId": "string",
  "turn": "number"
}

UI Operation

In the DSH interface, a rewind icon appears below each user message. The first click shows a prompt, and the second click confirms the rewind.

Notes

  1. Irreversible: The rewind operation is irreversible.
  2. Model trace: A one-line Chinese note will remain in the model context, for example, “The user has rewound this turn of conversation.”
  3. Compaction restriction: If the starting point of the target turn has already been absorbed by compaction, the rewind will be rejected.
  4. Boundary logic: Boundaries are determined based on the “model-visible order,” not by seq comparison.
  5. Unofficial implementation: The button is injected via DOM manipulation and is not an official slot.
  6. Scope of impact: Only the model history and the turns hidden by this plugin are affected.
  7. Dependency: Depends on the turnOutline projection.
  8. Running state: The rewind operation first stops the currently running turn.

Brief Closing

dsh-sqy-rewind provides session rewind capability for DSH, allowing you to avoid restarting a session during debugging and interactive use. The related code and documentation are available on GitHub: https://github.com/LUDIWUSI12138/dsh-sqy-rewind.

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

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

Xiaoye