Introduction

In the conversation flow of DeepSeek Harness (DSH), when you need to modify a previous user input and regenerate the response, you usually need to manually truncate history or start a new session. The dsh-plugin-edit-regenerate plugin adds an “Edit” button under each user message bubble, allowing you to directly edit historical messages. After confirming the revision, the system forks a new session and regenerates the response from the revised prompt.

Plugin Positioning

This is a DSH plugin maintained by StabCut, categorized as a “Workflow”. Its core function is to allow you to edit user messages in conversation history and regenerate responses in a forked session based on the revised text.

Core Features

  1. Edit and Regenerate: Click the “✎ Edit” button under a user message bubble, modify the text, and confirm. The system will discard all content after the current point and regenerate in a new session.
  2. Fork Session Policy:
    - Non-first message: Fork a new child session at the end of the current turn.
    - First message: Create a blank session and use the revised text as the opening.
  3. Attachment Handling: Messages with attachments are resent as plain text after revision; the attachments themselves are not retained.
  4. Feature Preservation: The original “Copy” feature is retained (the ⧉ Copy button and ✎ Edit button coexist).
  5. Storage Mechanism: Session storage uses an append-only log and does not support in-place truncation.

Installation and Enablement

After installation, restart DSH for the changes to take effect. The plugin uses the --profile parameter to specify the installation target.

# DSH Desktop app (Electron)
dsh plugin --profile desktop add file:./dsh-plugin-edit-regenerate

# Official launcher / CLI (dsh web)
dsh plugin --profile web add file:./dsh-plugin-edit-regenerate

If you need to install manually, add the dependency to the corresponding Profile’s package.json and run pnpm install.

Typical Usage

  1. In the conversation interface, find any user message.
  2. Click the “✎ Edit” button below the message bubble.
  3. Modify the text content (or remove attachments).
  4. Confirm the revision.
  5. The system will fork a new session and regenerate the response using the revised text.

Applicable Scenarios and Notes

This plugin is suitable for scenarios where you need to correct the previous turn’s prompt during a conversation. Keep the following in mind:

  • Session Loading Limitation: A forked session may fail to load after restarting DSH. If the parent session contains events that Harness does not recognize (for example, session/distill-review-request), a SessionFormatUnsupportedError will be thrown. If you encounter this issue, run the repair script.
  • Attachment Loss: Revised messages will no longer contain attachments; only text is retained.
  • No Truncation Support: Because storage is append-only, intermediate content cannot be deleted directly locally. Forking is the native DSH platform implementation of “edit and regenerate”.
  • Update Mechanism: Because pnpm copies file: dependencies into node_modules, after updating the source code with git pull, the corresponding installed Profile must manually refresh the copy in its node_modules.

Troubleshooting

If a forked session cannot load after restarting DSH, the parent session log likely contains events that Harness does not recognize. You can use the repair script provided by the plugin:

node scripts/repair-session-logs.mjs

This script traverses log files under $DSH_HOME/sessions, marks incompatible events as ignorable: true, and backs up the original files.

Summary

By providing an editing entry point in the UI layer and working with the Fork mechanism, the plugin enables regeneration of a specific node in conversation history. For developers who need fine-grained context control, this is a useful auxiliary tool.