Introduction¶
When running agents using the DSH Web interface, two common needs often arise: one is to fix wording or formatting issues in a specific assistant response without re-running the entire turn; the other is to revert to a specific turn and regenerate with a different question. Since conversation logs are event-sourced, directly editing files is impractical; building a custom set of “edit message + regenerate” HTTP interfaces and UI buttons is also a significant undertaking.
The dsh-msg-edit introduced below turns this into a plugin: once installed, the assistant message action bar in the DeepSeek Harness Web interface will feature two new buttons—“Edit this reply” and “Regenerate reply,” which are powered by four HTTP RPCs behind the scenes.
What is this?¶
Maintained by @moton16, licensed under MIT, the current version is 0.1.0. The plugin consists of two parts:
- Host plugin (Cordis node side): provides four HTTP RPCs under
/api/msg-edit/*; - Client plugin (declarative
dsh.client): injects buttons into the assistant message action bar and pops up an editor.
The entire package is a pure declarative Cordis bundle, with dsh.bundle.patch pointing to cordis.patch.yml. It has no install scripts, no build steps, and no source patching tools. It is compatible with @deepseek-ai/dsh-base and @deepseek-ai/dsh-web-app 0.1.0-rc.6 (as declared in peerDependencies). It relies on DSH’s slot system (conversation.chat.assistant-actions), webServer.register, and the sessions/agents services.
Core Features¶
The four RPCs on the host side each handle one task:
rewrite-message: Rewrites a single assistant response (body/thought), without truncating subsequent messages;edit-message: Edits a user message, truncating all nodes after it and regenerating;regenerate: Regenerates a specific response, tracing back to the original user message it belongs to;get-message: Reads the current text of an assistant response, used for pre-filling during editing.
The client side handles only the UI: injecting the “Edit this reply” and “Regenerate reply” buttons into the assistant message action bar; clicking edit pops up an inline editor for “Thought/Body”, and saving calls rewrite-message.
Two boundaries need clarification: editing and regenerating append surface-replace clone events to the event-sourced log, rather than rewriting history; the UI entry point for “inline editing of user messages” is outside the scope of this plugin (the user slot is exclusively used by the official ui-conversation), but the host’s edit-message RPC remains available and can be called by other UIs.
Installation and Enablement¶
Choose any of the three methods.
Method A (Recommended): Execute in the profile directory ($DSH_HOME/profiles/<profile>):
dsh plugin --profile web add @moton16/dsh-msg-edit
dsh will install the package from npm and automatically append the two plugin lines to the profile’s patch layer after reading dsh.bundle.patch.
Method B: Install via Git:
dsh plugin --profile web add github:moton16/dsh-msg-edit
The repository has pre-built lib/ (runtime JS), so prepare/postinstall scripts are unnecessary. If pnpm prompts for build authorization, allow this package in the allowBuilds section of the profile’s pnpm-workspace.yaml (only allow if the source code is trusted).
Method C: Manual mounting (local development). First, put lib/ into the profile dependency tree (or pnpm link); then append the two plugin lines to the profile’s cordis.patch.yml:
- insert:
- id: msg-edit-host
name: '@moton16/dsh-msg-edit'
- id: ui-msg-edit
name: '@moton16/dsh-msg-edit/client'
You can also launch directly using the repository’s cordis.yml as a --patch overlay:
dsh web --profile web --patch ./cordis.yml
After installation, you must manually restart dsh web (this plugin does not restart for you); for Method C, press Ctrl+F5 in the browser after restarting.
Verification¶
Following the steps above, you can verify the plugin is working from both sides.
Host side: Send a POST request with an empty parameter to any of the four routes. If it returns HTTP 200 with {ok:false,error:{code:'bad-request',...}}, the routes are registered:
curl -X POST http://127.0.0.1:<端口>/api/msg-edit/get-message
Client side: Hover over an assistant message; two buttons—pencil (Edit this reply) and loop (Regenerate reply)—should appear. Clicking edit should pop up an inline editor for “Thought/Body”.
The repository’s docs/VERIFICATION.md contains local verification records: plugin routes 4/4, UI button rendering, and screenshot evidence.
Applicable Scenarios and Notes¶
Suitable for developers who deploy DSH Web themselves, need to correct assistant response wording, or want to revert and rerun a specific turn.
Please note before installation: the plugin runs with the permissions of the current dsh process; check the source code and license before installing (this package is MIT licensed). Additionally, on dsh 0.1.0-rc.6, the companion components have several behaviors regarding surface-replace clone events that are not officially covered; the installer needs to handle this based on the local situation:
- token-meter replay crash (functional correctness dependency):
_foldEventindsh-token-meter@0.1.0-rc.6throws an error when replaying a replace clone, causing/compactto fail; the official repository’s master branch has not yet merged support. The “Compatibility Patch” section in the README provides a community fix; the installer should evaluate and apply it themselves. This package does not include patch scripts to remain compliant. - surface projection: The official renderer lacks immediate projection for replace clones. Without the community projection logic applied, editing results are only visible after refresh/replay.
- agent-loop deduplication: After editing/regenerating, agent-loop may append the same user/message multiple times, resulting in a wasted turn. The community deduplication logic (skip if tail has same id) can eliminate this; it is not a crash-level issue.
- User message edit button: The UI entry point is outside the scope of this plugin, as mentioned above; it can be called by other UIs via the host’s
edit-messageRPC.
Limitation 1, if not handled, will cause /compact to fail, while limitations 2-4 are experience-level. Once the official corresponding components merge support, this plugin will work without modification.
Summary¶
In short: dsh-msg-edit turns “edit a reply, rerun a turn” into a ready-made operation in DSH Web using four RPCs and two buttons; it is mounted purely declaratively; install and restart to use, with the caveat that you need to handle the known limitations on rc.6 as described in the README.
- Community Directory Page: https://www.skillhub.cn/plugins/moton16/dsh-msg-edit
- GitHub Repository: https://github.com/moton16/dsh-msg-edit
The community directory is an independent site with no official affiliation to DeepSeek or Hyperbolic.