Edit a sent message to rewind and branch the conversation from that turn, switch versions with a counter under the bubble, and browse every branch in a turn-level version tree.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-plugin-message-edit
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:SpookySandwich/dsh-plugin-message-edit
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 简体中文
Edit a message you already sent and the conversation rewinds and branches from that point, the way ChatGPT, Claude and DeepSeek all do it. The old version is not overwritten — a ‹ 2/4 › counter appears under the bubble, and a Versions tab draws the whole tree.

Version Tree Visualization
No matter how deeply conversations diverge or how many times prompts are edited, the Versions tab projects a clear, turn-level branching hierarchy with real-time active path highlights and instant navigation:

What it does
- Edit and branch. Revise a past prompt and send: a new branch regenerates from the full context before that turn. This is a true rewind, not a fork that continues from the end. The branch keeps the conversation's model, reasoning effort, agent preset and agent teamwork setting.
- Version counter. When a message has alternatives,
‹ n/m ›appears beneath it. The arrows move between them instantaneously. - Version tree. A Versions tab lays the branches out as a graph you can pan, zoom and drag. The current path is highlighted; click any node to jump to that conversation.
- Zero-flicker instant switching. Family-aware SWR client caching enables 0ms version switching and graph navigation without indicator flicker or loading delays.
- In-memory host caching. Parsed turns and version metadata are cached in host memory, eliminating redundant disk I/O and JSON parsing for deep branching trees.
- Automatic cancellation. Branching immediately cancels any still-streaming obsolete sibling turns across the conversation family to save tokens and compute.
- Retry. Re-run a turn without editing it (Claude layout).
- Copy. Put the message text on the clipboard.
- Durable. Every branch is a real persisted session, and version links are stored as durable events so the tree survives restarts. New branches automatically group into the parent session's workspace.
Interface style
In Settings → Message Edit, enable Group versions into one sidebar entry to show an original conversation and its recorded edit/retry version family as a single sidebar row, including in search results. This option is off by default to preserve the existing list behavior.
- Scope and lineage. Each recorded edit/version family collapses to its original root row while all branches remain accessible in the Versions tab and
‹ n/m ›bubble switcher. Native independent conversation copies (such as Branch into a new conversation in DSH0.2.2-rc.1, which deliberately omits parent lineage) have no recorded parentage and remain separate root entries. Orphan branches whose parent is missing remain visible, and subagents are never merged into ordinary conversation versions. - Root ownership and aggregated activity. The grouped row retains the original root session's actual title, workspace membership, pin state, and archive state. Pinning or archiving the grouped row acts on the root session only (it never batch-archives, deletes, or rewrites family branches). Latest activity timestamps, running states, and running subagent counts (
runningChildCount) are aggregated across the family, and viewing any branch highlights the shared row. - Actionable status and click priority. Projected status flags and ordinary row clicks use the same set of eligible, visible, non-archived ordinary family members (preferring the original root first within each priority level, then native catalog order):
- Eligible pending interaction (
approval,plan-review, orquestion) first, - Eligible unread completion next,
- Remembered non-archived version (when Remember the version I was viewing is enabled) or the original root as fallback. Actionable status temporarily takes priority over the remembered version so hidden attention states remain directly reachable. The host acknowledges only the specific session actually opened (there is no automatic bulk mark-read across the family), so multiple unread versions can be visited individually on subsequent clicks.
- Eligible pending interaction (
- Search navigation and known limits. Clicking a search result with an explicit content snippet (or a unique hidden-version match) opens that matched version directly, taking precedence over pending/unread status and the remembered version:
- In Show archived (
All conversations), if the root is live and only archived hidden versions match a content search, the grouped result can render with the live root's styling and without an inlineUnarchivebutton; clicking it clears the search query and displays the native archived-session notice (Archived sessions cannot be opened. Unarchive it to view.) rather than navigating or unarchiving. Unarchive the branch from the Versions tab or the ungrouped archived view instead. - When full-text search is disabled and multiple hidden versions share a matching title (without the root title matching), clicking the deduplicated family hit opens a matching version (the first eligible match), not necessarily the remembered version.
- On older hosts (
0.2.0-rc.2,0.2.1-rc.2, and0.2.1-rc.5), grouped fallback search can match hidden version session IDs, whereas native ordinary/root session-ID search is not supported by those hosts; DSH0.2.2-rc.1supports session-ID search for all sessions.
- In Show archived (
The three interfaces this imitates differ in where the controls sit and which ones exist, so the preset changes exactly that — never the colours, which stay native to DSH. Pick one under Settings → Message Tree; the panel previews it live.
| Preset | Controls under the bubble | Shown | Editor buttons |
|---|---|---|---|
| ChatGPT | edit, copy | on hover | Cancel / Send inside the box |
| DeepSeek | edit, copy | always — like DSH itself | Cancel / Send inside the box |
| Claude | retry, edit, copy | on hover | Cancel / Save below the box |
Only Claude offers retry on a user message, matching the real interface. There is no share button, because DSH has none.
Install
dsh plugin --profile web add dsh-plugin-message-edit
Restart DSH afterwards — the host half loads with the server. The interface follows DSH's display language (English / 中文 / Русский). Russian is available in the language selector; untranslated host UI falls back to English.
How it works
DSH sessions are append-only event logs with no in-session branching, so a rewind has to be built:
- The host half serves
/message-tree. Editing a message creates a new session seeded with every event before the target turn, writes a durablemessage-tree/versionmarker naming what changed, and submits the edited prompt. - Those markers are read back to reconstruct the tree, the
‹ n/m ›ring, and which branch you are currently on. - The marker is written with the envelope's
ignorableflag. Plugin event types live outside the harness vocabulary, and without that flag the reader refuses to interpret the whole log — the session simply fails to open. - Only the plain
usermessage node is shadowed, at priority-1. Reasoning, tool calls and steering rows keep the host renderer.
The host-side branching logic derives from dsh-message-edit (MIT © Moeblack), reworked for ChatGPT-style rewind semantics, sibling fan-out, and the interface presets above.
The names are similar, so to be explicit: this is a separate plugin. Its route, cordis id and durable event type keep a distinct message-tree spelling precisely so both can be installed side by side without colliding.
Documentation
For technical details and developer guides, see:
- Architecture Overview: Host/client architecture, Cordis lifecycle injection, durable event storage, and HTTP API.
- Tree Data Model & Algorithms: Turn-level message tree projection, sibling fan-out, ghost recovery, and active path calculation.
- Development & Testing Guide: Build pipeline, automated test suite, and local installation instructions.
Compatibility
Unreleased: Support official DSH 0.2.2-rc.4 and 0.2.2-rc.5 by admitting them explicitly in the declared host ranges, while retaining all previously supported hosts; neither needs a plugin runtime change. Users can still edit or retry prompts whose turns ended in CONTENT_REFUSED; branching keeps the correct turn boundary, and retained failed-attempt output stays outside successful answer history. Editing or retrying a message now keeps the conversation's agent teamwork mode, which DSH otherwise turns off in every new session (#13, reported by @Arkos123); the branch's own task board and teammates start empty. Official DSH 0.2.2-rc.4 and 0.2.2-rc.5 require Node >=24.9.0. See the unreleased notes for validation details.
Version 1.6.1: Support official DSH 0.2.2-rc.3. Editing or retrying imported history without a live agent now uses DSH's current default model when no request/header exists; native histories retain their recorded model and controls. Branches without a recorded agent preset resolve and mount DSH's configured default, preserving its persona, instructions and tools even after an imported chat gains native turns. File cards in both native and imported messages are passed to the host content renderer alongside images, including metadata-only files. The compatibility range admits 0.2.2-rc.3 explicitly and continues to exclude untested 0.2.2-rc.2 and future prereleases.
Version 1.6.0: Add opt-in sidebar grouping for conversation versions (#12, contributed by @ganpig) and support official DSH 0.2.2-rc.1 (upstream tag dsh-v0.2.2-rc.1, commit 66491b05e3f05ad35bcdd4f6cd7ed26041d9e3db) while retaining 0.2.0-rc.2, 0.2.1-rc.2, and 0.2.1-rc.5 compatibility. Declared host compatibility ranges (peerDependencies and engines.dsh) explicitly include 0.2.2-rc.1 (>=0.2.0-rc.2 <0.3.0-0 || 0.2.1-rc.2 || 0.2.1-rc.5 || 0.2.2-rc.1). Official DSH 0.2.2-rc.1 requires Node >=24.9.0; the plugin retains Node 22.19+ and Node 24 compatibility for earlier supported DSH hosts without adding a higher global Node floor. Includes recorded-lineage sidebar grouping (off by default), root-owned workspace/pin/archive semantics, family running and subagent activity aggregation, actionable status priority (approval/plan-review/question → unread completion → remembered/root fallback with per-session host acknowledgement), explicit content-search target routing, streaming-stable search callbacks, native user-message text-interaction source marking for DSH 0.2.2 Quote selection, and light-theme card/control surface contrast (--dsw-alias-bg-base). Verified across 102 automated tests, release/package checks, fresh and restart API acceptance on official 0.2.0-rc.2, 0.2.1-rc.2, 0.2.1-rc.5, and 0.2.2-rc.1 runtimes, and isolated real-browser Web acceptance on official 0.2.2-rc.1 and 0.2.1-rc.5.
Version 1.5.0: Support official DSH 0.2.1-rc.5 while retaining 0.2.0-rc.2 and 0.2.1-rc.2 compatibility. Declared host compatibility ranges (peerDependencies and engines.dsh) explicitly include 0.2.1-rc.5 (>=0.2.0-rc.2 <0.3.0-0 || 0.2.1-rc.2 || 0.2.1-rc.5). Verified on official 0.2.0-rc.2, 0.2.1-rc.2, and 0.2.1-rc.5 runtimes for fresh and restart acceptance, user message edits with retained images, version navigation, retry branching, and 400px More-menu navigation.
Version 1.4.1: Override @deepseek-ai/dsh-mcp-client to @modelcontextprotocol/client 2.3.0 (with @modelcontextprotocol/core 2.3.0) in this repository's checkout lockfile to cover GHSA-6qxp-vccf-f47h (CVE-2026-104850, fixed in 2.2.0) and GHSA-6prh-2h8m-c8cw (CVE-2026-111769, custom-header/body cross-origin redirect disclosure, fixed in 2.3.0; Node HTTP transports in 2.3.0 follow same-origin redirects only and require the final URL for cross-origin MCP endpoints). This hardens development/test checkouts of this repository only; npm ignores dependency overrides and does not ship package-lock.json, so installing the plugin does not modify an existing user's DSH host.
Version 1.4.0: Add a Russian (ru / Русский) client locale covering all 37 UI and image strings and register Русский in the DSH host language selector (with English fallback for untranslated host UI; if no explicit DSH language preference is stored and browser language preferences list Russian before Chinese, auto-detection selects Russian and falls back untranslated host UI to English; a preloaded ru language pack is respected, whereas a separate ru pack loaded after this plugin would collide on duplicate registration).
Version 1.3.1: Render user message images through the host conversation.chat.user.content factory (preserving the native gallery and lightbox) when the legacy renderMessageImages callback is absent, with an async loadImage / loadImage.peek thumbnail fallback.
Version 1.3.0: Admit official dsh 0.2.1-rc.2 in declared compatibility ranges and verify live/persisted edits and retries on official 0.2.0-rc.2 and 0.2.1-rc.2 runtimes.
Version 1.2.1: Fix DSH 0.2 client activation and route edits, retries, and version switching through uiWorkspace.openSession.
Version 1.2.0: Unarchive a version through workspaceRegistry.unarchiveSession on official dsh 0.2.0-rc.2.
Version 1.1.0: Fix seeded edit/retry creation, clear inherited pending input before publication, identify version markers by session ownership, preserve reasoning effort, and read persisted branches through disposable session observations.
The declared host range is >=0.2.0-rc.2 <0.3.0-0 || 0.2.1-rc.2 || 0.2.1-rc.5 || 0.2.2-rc.1 || 0.2.2-rc.3 || 0.2.2-rc.4 || 0.2.2-rc.5; official dsh 0.2.0-rc.2, 0.2.1-rc.2, 0.2.1-rc.5, 0.2.2-rc.1, 0.2.2-rc.3, 0.2.2-rc.4, and 0.2.2-rc.5 satisfy it. Keep the previous plugin release on older DSH. Validation record (runtime matrix).
Install published versions from npm. To test the current source, run npm ci and npm pack, then dsh plugin --profile desktop add ./dsh-plugin-message-edit-1.6.1.tgz. See the release procedure for publication checks.
Version 1.1.0 has been verified in an isolated DSH 0.1.5-rc.2 Web environment:
plugin loading, images, edit/retry, nested branches, and restored sessions. Model
responses use a local test adapter; remote model services were not exercised.
The compatibility layer retains the older events / seedLength interfaces,
covered by automated tests. Current source targets official dsh 0.2.2-rc.5.
Restart DSH after updating the plugin.
Coexists with dsh-plugin-smooth-stream and dsh-plugin-rollout-scout.
License
MIT © SpookySandwich. Portions of the host half derive from dsh-message-edit (MIT © Moeblack).
Links
More in this category
ranxianglei/billion-context★ 8035
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Minglink/dsh-infinite-gen-4★ 4612
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 735
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
MichengAI/dsh-archive-manager★ 383
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 324
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
SiriLee/dsh-rewind★ 292
Conversation rewind: one click back to any earlier user message, in the same window — no new branch, no leftover copy; the target message is refilled into the composer, with optional workspace-file restore — the full Claude Code /rewind semantics.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.