Delete one finished turn from a DSH conversation without deleting the session — the trash button next to the last assistant reply removes the question, that reply and the tool records of the turn from the conversation surface and from the model context, while the session id, title, later turns and the append-only log stay; the removal is written as a persistent tombstone, so it survives a reload.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/TiJun-Prime/dsh-turn-delete/releases/latest/download/dsh-turn-delete.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:TiJun-Prime/dsh-turn-delete
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 | 中文
Delete one complete closed turn from a DeepSeek Harness conversation without deleting or replacing the Session. The action appears beside the final assistant response for each completed top-level turn.
This repository is an independent continuation of hanshenmesen/dsh-turn-delete. The upstream main branch has not merged this repository's compatibility fixes, so they are maintained here, tracking DeepSeek Harness
0.1.5-rc.2surface rules and the0.2.0-rc.1plugin compatibility gate.
Demo
Delete the middle turn after confirmation while keeping the same Session and its later turn. Recorded through the real DeepSeek model flow on DeepSeek Harness 0.1.0-rc.7; the interaction is the same in the current version.

Behavior
- A trash action appears only on completed ordinary Session turns. Subagent transcripts do not expose it.
- Deletion requires confirmation and is disabled while the Session is running.
- Immediate: a successful deletion conceals the removed turn's rows in place, so the turn leaves the transcript without switching Sessions; the durable tombstone keeps it hidden on every later full render.
- A durable replacement event records the deletion. Reloading the page or restarting the profile preserves it.
- The Session's system-prompt node is never part of the removed span.
- The Session id, title, workspace association, later turns, and original append-only event log remain intact.
- Repeating the same request is idempotent.
The plugin refuses deletion when the target turn is still open or has already been folded into a compaction summary with other history: a summary is replaced as a whole, so one turn inside it cannot be removed on its own. That refusal is reported as such. An unexpected internal failure is reported as a failure with its reason — never as "the task is running".
Install
From a local directory (development):
dsh plugin --profile web add -w link:/absolute/path/to/dsh-turn-delete
From GitHub (a private repository needs credentials on the machine):
dsh plugin --profile web add github:TiJun-Prime/dsh-turn-delete
From a prebuilt GitHub Release (once a release exists):
dsh plugin --profile web add https://github.com/TiJun-Prime/dsh-turn-delete/releases/latest/download/dsh-turn-delete.tgz
Restart dsh web after installation (restart the desktop app on a desktop shell). To remove it:
dsh plugin --profile web remove dsh-turn-delete
Differences from upstream (0.2.0)
- DSH 0.1.5-rc.2 compatibility: surface replacements use
{ op: 'replace', startSeq, endSeq }, and the tombstone carrier changed fromassistant/messageto an emptysystem/message— 0.1.5 forbidssourceEventSeqsonassistant/message, while an empty system node both cites its sources and projects to no wire message. Tombstones written by older builds are still recognized. - The system prompt is never part of the removed span: 0.1.5's
assertSystemHeadRewriteprotects surface node 0, which a first turn's span could include. - Honest error reporting: internal failures (for example a changed kernel API) are no longer wrapped as
AGENT_BUSY;DELETE_FAILEDreports the real reason, and only a genuinely non-idle Agent reports "the task is running". - Immediate concealment after a delete: the chat's turn-tail row is not re-rendered by a live append, so the action conceals its own turn's rows directly.
- Tooling: build/check scripts work on Windows (the
.binshim problem is fixed), andnpm run checknow smoke-tests the built host bundle against the real kernel through its HTTP route.
0.2.1: the 0.2.0-rc.1 plugin compatibility gate
Since DeepSeek Harness 0.2.0-rc.1, profile startup runs evaluatePluginCompatibility() over every plugin's peerDependencies: each peer whose name is @deepseek-ai/dsh or starts with @deepseek-ai/dsh- must be satisfied by the running kernel version under semver with includePrerelease: true. A plugin that fails is neither reported nor loaded — its loader entry stays at enabled: false, the plugin manager shows "entered the profile bundle layer but could not be hot-mounted; effective after restart", and the kernel log contains no line about it at all.
Two traps:
- Declaring only the tested older version (for example
^0.1.5-rc.2) evaluates to false on0.2.0-rc.1, so the plugin is simply not loaded. - Prerelease ranges are counter-intuitive:
>=0.1.5-rc.2 <0.3.0also evaluates to false (no stable tuple exists inside that range). A union such as^0.1.5-rc.2 || ^0.2.0-rc.1is required.
0.2.1 therefore declares ^0.1.5-rc.2 || ^0.2.0-rc.1 for all five @deepseek-ai/dsh-* peers, so one package serves both kernel lines; no code change was needed (surface events, the system/message shape, slot ids and the data-turn-tail / data-chat-flow-kind DOM contract were all verified unchanged on 0.2.0-rc.1).
If the action disappears after a kernel upgrade, re-enable the plugin in the plugin manager (it writes a profile patch row and hot-mounts the plugin) or restart the app; 0.2.1 is accepted by the gate.
Design
The Host half registers POST /dsh-turn-delete: it claims the target Agent's maintenance lease, validates the complete closed-turn surface span, appends a durable replacement, and waits for sessions.flush() before acknowledging success. The replacement is an empty system/message carrying surfaceOp: { op: 'replace', startSeq, endSeq } plus the sourceEventSeqs it shadows.
The browser half contributes to the public conversation.chat.assistant-actions and conversation.chat.turnTail slots. A Conversation definition projects the durable tombstone onto the target Turn's Location data, and a marker component hides the Chat rows between adjacent Turn tails. DeepSeek Harness does not yet expose a public whole-Turn visibility hook, so that presentation compatibility layer is row-scoped; model context deletion does not depend on it.
Compatibility
- DeepSeek Harness
0.1.5-rc.2and0.2.0-rc.1(surface replacements use{ op: 'replace', startSeq, endSeq }) - Node.js 22.19 or newer
- Web profile and Web-based desktop shells
peerDependencies declares ^0.1.5-rc.2 || ^0.2.0-rc.1. On a kernel version outside that range, Harness builds after 0.2.0-rc.1 refuse to load this plugin (see the section above); update the package, or grant an explicit per-version exemption for it in the plugin manager.
DeepSeek Harness is in developer preview and changes its surface API between releases. After upgrading Harness, verify the plugin once with a disposable Session containing three short turns and delete the middle one.
Development
npm install
npm run check
dsh plugin --profile web add -w link:/absolute/path/to/dsh-turn-delete
npm run check type-checks, builds both plugin halves, runs the unit/UI tests, smoke-tests the built host bundle against the real kernel through its HTTP route, and verifies the npm package contents.
Security
Like every DSH plugin, this package runs with the Harness process's permissions. Review the source before installing third-party plugins. The deletion changes future model context but deliberately retains the original append-only events for audit and replay.
License
MIT
Links
More in this category
ranxianglei/billion-context★ 8543
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★ 4775
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★ 767
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
ECNU/EduWork#dsh-side-chat★ 423
Open temporary side conversations from a message with a snapshot of its history, then archive them on close; optional annotation integration adds selection-based questions. Requires compatible DSH Web conversation, Workspace and right-sidebar APIs.
MichengAI/dsh-archive-manager★ 398
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 331
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.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.