DeepSeek Harness Plugin

haoranwang0921/dsh-session-cleaner

Stars ★ 6 Category Sessions & Messages Added 2026-08-23

Manage conversation records from the DSH web GUI settings page: delete a whole session (archive plus physical log removal) or a single message (deleting a user message cascades to its assistant replies and tool results). Running and current sessions are protected.

Install

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:haoranwang0921/dsh-session-cleaner

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

A DeepSeek Harness Web GUI plugin: manage and delete conversation records from the settings page.

中文

Features

  • Delete a whole session: archives the session and physically removes its durable log (JSONL directory), and cleans up that session's message-feedback data.
  • Delete individual records: conversations are grouped by user message; deleting a user message cascades to all assistant replies and tool messages it triggered.
  • Grouped browsing: in the settings page "会话管理" (Session Manager), click a user message to expand the assistant/tool messages it triggered; each child message can be deleted individually.
  • Safety guard: running sessions and the current session cannot be deleted (enforced on the Host side).

Requirements

Installation (first-class plugin, loads automatically on startup)

This repository is a dual-face plugin package: the node half runs in the host process (/api/session-cleaner routes), and the browser half loads into the Web GUI through the dsh.client declaration.

# 1. Install into the profile (link path for local development; package name after npm publish)
dsh plugin --profile web add link:C:\path\to\dsh-session-cleaner

# 2. Restart dsh web
dsh web

After installation the plugin loads automatically with every DSH startup — no re-install needed. Entry point: Settings → 会话管理 (Session Manager).

Code updates need no rebuild (plain JavaScript); just restart dsh web.

How it works

  • cordis.patch.yml (the dsh.bundle.patch manifest) inserts one session-cleaner plugin row into the profile composition.
  • The dsh.client declaration in package.json loads the browser half from /plugins/<id>/client.js; exports["./client"] points at the bundle.
  • The node half registers /api/session-cleaner/* routes (loopback-only) through webServer; the browser half calls them via fetch.

Uninstall / update

dsh plugin --profile web remove @haoranwang0921/dsh-session-cleaner

Or edit $DSH_HOME/cordis.patch.yml / the profile's cordis.patch.yml to disable or delete the session-cleaner row.

Deletion semantics (important)

DSH session logs are append-only:

  • Deleting a whole session: physically removes the session's log directory — its records are gone for good (except content-addressed shared attachments).
  • Deleting a single message: removes the target from the model context via the surface-replace mechanism (same semantics as /compact), but the original events remain in the log and in the human transcript; the message disappears from this plugin's list.

File layout

  • lib/index.js — node half (Host): the /api/session-cleaner/* routes and deletion logic.
  • lib/client.js — browser half: the settings-page "Session Manager" grouped view.
  • cordis.patch.yml — bundle patch (inserts the plugin row into the profile).
  • dynamic/ — the legacy dynamic Cordis plugin form (cordis_define / cordis_run loading, lost on DSH restart), kept for reference.
  • LICENSE — Apache-2.0.

Disclaimer

Deletion is irreversible. Confirm the target session/message before acting; the author is not responsible for data loss.

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.