Back to home

qwased

DSH-deleted-and-history-button

DeepSeek Harness (DSH) community patch: archived session list view + permanent session delete with confirmation for the Web UI

Stars
0
Language
Shell
Created
Aug 16, 2026
Updated
Aug 16, 2026

Introduction

DSH deleted-and-history-button

Add archived session list + permanent session delete (with confirmation) to the DeepSeek Harness Web UI.

  • Archived view — the sidebar "Group by" menu gains an Archived mode that lists every archived session (newest first), so archives are finally reachable from the UI.
  • Permanent delete — session rows (normal and archived views) gain a danger Delete session action backed by a confirmation dialog. Deleting a live session disposes its agent first; the durable log, Workspace accounting, and archive-set entry are all removed. Deleting the currently open session returns to the empty state.

This is a community source patch for a DeepSeek Harness checkout, not an npm-installable plugin: the feature spans core capability seams (a new session.delete RPC, persistence delete, Workspace accounting cleanup, the client sessions service, and the workspace-browser UI), which a standalone plugin cannot reach. It follows the same "patch repo" convention as other community DSH extensions.


Features

  1. Archived session list

    • View options menu → Group by → Archived shows a flat, newest-first list of all archived sessions.
    • Each archived row keeps the full row menu (open / rename / fork / delete); archive set changes propagate live.
  2. Permanent session delete

    • Row menu → Delete session (danger-styled), confirmed by a modal that names the session and states the operation is irreversible.
    • Works for both live and cold sessions, archived or not.
    • Deleting a running session disposes the agent before removing the log.
    • Subagent-routed sessions are rejected by the host (agent-busy) to protect delegation.

How it fits the DSH plugin philosophy

Everything lands on existing plugin seams — no shell/kernel changes:

LayerSeamWhat the patch adds
Persistencectx.sessionPersistence (JSONL / SQLite swappable backends)SessionPersistence.delete abstract → coordinator delete → backend PersistenceBackend.deleteStored
Workspace accountingctx.workspaceRegistryWorkspaceRegistry.deleteSession (detach entities + clear archive set + forget indexes)
Wire contractSessionsApisession.delete RPC (schema / rpc-map / fetch client+handler / api-proxy + agent-handle retention)
Client servicectx.sessions (ISessions face)deleteSession — RPC + local row removal (cold sessions emit no frame)
Web UIui-workspace (runtime-loaded bundle, sidebar.workspaces slot)archived grouping + delete action/modal; injected via the owner contract
Test doublesconnection fixture / TestSessions / fake APIssynchronized implementations (compile-time contract lock)

Dynamic-loading notes: the Web shell never bundles UI plugins (they arrive as runtime bundles through the client module system), so this patch only rebuilds the ui-workspace bundle plus the libs; the shell bundle is untouched. The client list stays live because the host pushes host/session-removed, host/workspace-changed, and host/archived-sessions-changed frames.

Compatibility

  • Target: a deepseek-harness git checkout at or after base commit 47f9438 (Merge pull request #2519).
  • The patch applies to source; the build must be re-run afterwards (see below).
  • Both JSONL and SQLite persistence backends are supported.

Installation

# 1. Clone the harness (or use an existing checkout at a compatible revision)
git clone https://github.com/deepseek-ai/deepseek-harness.git
cd deepseek-harness
pnpm install

# 2. Apply this patch (from this repo)
bash /path/to/DSH-deleted-and-history-button/apply.sh "$(pwd)"

# 3. Rebuild (no dev server is assumed; HMR is not available for core changes)
pnpm run build:lib:host
pnpm run build:lib:client
pnpm --filter @deepseek-ai/dsh-web-frontend run build

# 4. Start the Web UI
node apps/cli/lib/bin.js web --port 3080

Windows: use apply.ps1 instead (PowerShell):

powershell -ExecutionPolicy Bypass -File .\apply.ps1 -CheckoutPath C:\path\to\deepseek-harness

The apply script checks the base revision and refuses to run on an already-patched tree. Use verify to confirm the feature markers are present:

bash verify.sh /path/to/deepseek-harness
# or
powershell -ExecutionPolicy Bypass -File .\verify.ps1 -CheckoutPath C:\path\to\deepseek-harness

Usage

  • See archives: sidebar → view options → Group byArchived. Archived sessions disappear from the normal views; the archived list shows them newest-first.
  • Delete: hover a session row → Delete session → confirm. The row disappears immediately; on-disk logs under ~/.dsh/sessions are removed; Workspace accounting and the archive set are updated.

Repository layout

PathPurpose
patch/dsh-deleted-and-history-button.patchThe complete unified diff (39 files) against base commit 47f9438
patch/FILES.mdFile-by-file change manifest
apply.sh / apply.ps1Apply the patch into a harness checkout (with base-revision check)
verify.sh / verify.ps1Verify the feature is present in a checkout
README.md / README.zh.mdThis documentation

Changelog

  • Fix (2026-08-16): opening an archived session no longer bounces back to the New Session view. The harness's archived-current sweep in WorkspaceRuntime.project() cleared the selection whenever the current session was a member of the archive set — so deliberately opening an already-archived session from the Archived view was immediately re-cleared into the empty state. The sweep is now a transition rule: it only clears when the current session just entered the archive set (archiving the open session via the local echo, a remote tab's frame, or a reconnect baseline), never when an already-archived session is opened on purpose. The first ready baseline seeds the tracked set so a persisted archived selection survives a reload.

Data desensitization

  • This repository contains no credentials, API keys, or user data. The patch is pure source code; the documentation references only public DeepSeek Harness paths and generic placeholders.
  • Do not commit ~/.dsh data (settings, credentials, session logs), node_modules, build output, or anything containing a real session id / local machine path when forking this repo.

Verification

  • pnpm run build:lib:host and pnpm run build:lib:client type-check and bundle cleanly.
  • Base-patch full unit suite (author-verified): 64 test files / 1083 tests pass, including the archived view, the delete row menu, and the delete confirmation flow.
  • Fix regression: packages/client/runtime (344 tests) and packages/client/ui-workspace (123 tests) suites pass with the new "opening an already-archived session keeps it current" test.
  • Manual GUI checks: opening an archived session from the Archived view shows its full history (no bounce to the New Session view); archived grouping lists archives; delete shows the confirmation dialog; confirming removes the row, clears the current selection, and deletes the on-disk session directory; deleting the open session returns to the empty state.

License

MIT — see LICENSE. Community contribution, not affiliated with DeepSeek.