dsh-conversation-rewind
Same-Session, append-only conversation rewind and safe user-message editing for the DeepSeek Harness web UI.
Features
- Adds an Edit history message action directly beside Copy under each editable user message. Editing is inline in that message row; no modal is opened.
- Replaces the rewind form with a visual message-branch tree. Clicking a node switches the path in the original Session.
- Rewinds inside the original Session: the Session ID and browser URL stay unchanged, and no child Session is created.
- Uses DSH Surface replacement metadata to hide the selected message, its old reply, and the later active path from both the current transcript and future model context.
- Keeps the durable event log append-only. Historical events are retained for audit/recovery; the plugin appends a replacement marker instead of rewriting or deleting them.
- Sends the edited text as a real new user turn so the assistant response is regenerated.
- Selecting a historical branch reactivates its ordinary user path in the same Session and regenerates the affected assistant responses; it does not create a child Session or change the URL.
- Offers
truncateandpreservehandling for later user messages. - Permanently guards its internal rewind trigger so it is cancelled before provider dispatch, including orphan recovery after a restart.
Same-Session semantics
- The plugin validates a completed, replay-safe user turn and rechecks the live Session before committing.
- A guarded internal turn appends a DSH
SurfaceOpreplacement over the selected message through the current active tail. - The internal trigger and shadowed path never enter the provider request.
- After that internal turn is fully idle, the edited message is queued as an ordinary user turn in the same Session.
- The new message and response are append-origin events, so the edited message can be edited again later.
The cascade modes control what is queued after the replacement:
truncate— send only the edited message and continue from there.preserve— send the edited message, then re-send each later ordinary plain-text user message in order. Historical assistant replies are not copied.
Safety boundaries
Only a completed turn containing exactly one direct, ordinary, plain-text user message is editable. Current injected context that precedes the target stays on the original Surface; context after the target must be a Host-owned regenerated system snapshot or skill catalog. Targets with attachments, non-text blocks, multiple direct user messages, an open/running turn, ambiguous inbox history, or unsafe later turns are hidden or rejected.
Editing currently requires the Session to be live in this DSH process. The operation fails closed if the Surface or inbox changes concurrently. A partial-result error identifies the original Session and replacement event if the Surface replacement committed but a later checkpoint failed.
Branches containing attachments, ambiguous user-role context, or another unsafe-to-replay turn remain visible in the tree but are disabled.
Rewind changes conversation history only. It does not restore workspace files or reverse tool calls, commands, network requests, or any other external side effects.
Requirements
- DeepSeek Harness
>=0.1.0-rc.6 - Node.js
^22.19or>=24 - DSH Web profile
Install
dsh plugin --profile web add \
https://github.com/DTSFO/dsh-conversation-rewind/archive/refs/tags/v0.1.3.tar.gz
dsh web
Remove with:
dsh plugin --profile web remove dsh-conversation-rewind
Use
- Open a completed Session in DSH Web.
- Click Edit history message beside Copy under the target user message. The editor appears in that message row; revise the text, choose Restart here or Replay later messages, and save.
- Open the Rewind view to inspect the message tree. Click an enabled node to switch to that branch in the same Session.
- The old path remains in the append-only log while the selected/edited path is regenerated in place.
Development and testing
pnpm install
pnpm run check
dsh plugin --profile web add /absolute/path/to/dsh-conversation-rewind
dsh web
pnpm run check runs TypeScript checks, ESLint, unit tests, and the production build.
Known limitations
- Editing is deliberately limited to replay-safe, single-message, plain-text user turns.
preservereproduces later user inputs, not historical assistant responses or original timing.- Branch selection replays ordinary user inputs and regenerates assistant responses; historical assistant output and original timing are not copied verbatim.
- Unsafe descendants are shown as disabled rather than silently omitting their non-text context.
- The Session must be open and live in the current Host process.
- Workspace and external side effects are not rewound.
- This release targets the DSH Web UI and DSH
0.1.0-rc.6APIs.
MIT
No comments yet. Be the first to write one.