Introduction¶
When developing agents in DeepSeek Harness (DSH), sessions accumulate along with projects and workspaces. The sidebar only offers official capabilities such as pinning, archiving, and forking; tasks like bulk cleanup, restoring from the trash, activity statistics, and context compaction thresholds often require manually digging through directories or editing configuration files. Furthermore, if a session ID originates from an unofficial entry point (e.g., od-<uuid>), standard deletion may directly throw an invalid-session-id error.
Below is an introduction to the community plugin dsh-session-manager (Maintainer: JeffKeeping, Category: “Memory”). Without modifying the DSH core, it adds a dedicated “Session Management” settings section for the Web interface, a drawer entry at the top of the conversation, and capabilities including deletion (recoverable / permanent / empty trash), force delete, restore from archive, statistics, resume and pause, log directory access, unread markers, workspace group sorting, and a global context compaction threshold. This repository is built based on dream12347/dsh-session-manager (MIT) v0.2.3, and the current release version is v0.4.1.
What is this¶
dsh-session-manager is a host + client plugin designed for the DSH Web client. The host side registers HTTP routes to handle deletion, trash, pause, statistics, and compaction thresholds; the client side extends the UI via official settings slots and sidebar menus. Data remains within DSH’s existing storage (session directories, ctx.sessionPersistence, ctx.workspaceRegistry, etc.); it does not add model tools or modify system prompts, and has no additional impact on tokens or model behavior.
- Directory Page: https://www.skillhub.cn/plugins/JeffKeeping/dsh-session-manager
- Source Code: https://github.com/JeffKeeping/dsh-session-manager
- License: MIT (Upstream: dream12347; this derivative version is also MIT)
Core Features¶
Session List and Entries¶
- Settings Page: A Session Management section is added to the left-side navigation, at the same level as Notifications. It displays sessions grouped by workspace (title / working directory). Within groups, you can toggle between “Newest First” and “Oldest First” based on last used time.
- Conversation Top: Entries for Conversation Management and Trash are retained. The self-drawn right-side drawer shares the same data source as the settings page and can be pinned or collapsed by clicking outside.
- Sidebar: A red Delete Conversation option is added at the bottom of the session row’s “…” menu (
sidebar.workspaces.session.menu.item, order 500). Starting from v0.4.1, the separate red delete button at the top of the conversation has been removed to avoid cluttering the title bar.
Deletion, Trash, and Force Delete¶
- Deletion first goes through the official archive channel, hiding the session from the sidebar immediately. Session files are moved to
~/.dsh/dsh-delete-session-trash/, and entries are persisted in~/.dsh/storages/dsh_delete_session.json. - The trash retains the most recent 10 entries; older ones are automatically cleared when the limit is exceeded. It supports Restore, single Permanent Delete, and Empty Trash (
POST /dsh-session-manager/purge-all, irreversible; in case of partial failure, records are kept andpurged/failed/remainingare reported). - If a standard deletion fails, a native Modal popup offers Force Delete (
POST /dsh-session-manager/delete, body includes{ sessionId, force: true }): this skips official archive validation and attempts to locate the session via the disk directory fallback before moving it to the trash (recoverable). Running sessions are always rejected for deletion; idle sessions that are currently open can be deleted. Child agent sessions (if not running) can also be cleaned up, including “orphaned” child agents whose parent session has been deleted. - v0.4.1 relaxes the session ID rules: it accepts
[A-Za-z0-9][A-Za-z0-9._-]{0,199}(prohibits..), rather than being limited tosession-<hex>.
Archive, Resume, Pause, and Fork¶
- A collapsible area at the bottom displays Archived Sessions with support for one-click restore to the list.
- Resume Session: Opens and closes the management panel; Pause: Stops the current turn of a running session.
- Resume in New Chat: Calls the official
sessions.forkto fork a child session and opens it. - Folder: Opens the session’s log directory in the system file manager (
POST /open-folder).
Statistics and Unread¶
- Statistics: A centered modal displays recent activity (turns, user messages, assistant messages, all tool calls, active window, etc.). Data comes from
GET /stats. - Unread / Read: Status dots next to the title—blue for manual unread, amber for official waiting-for-input, green for official completion reminder, and spinning for running. Clicking the official status dot marks it as read in place. The manual unread set is saved in the localStorage key
dsh.session-unread.v1, allowing interoperability with other session management plugins. The blue dot in the sidebar decorates the official tree via title text (shared if titles are duplicated; precisely marked by real session ID within the drawer).
Workspaces and Context Compaction¶
- Hovering over a workspace title reveals Move to Top / Rename / Delete (deleting a workspace only removes it from the list; its sessions are categorized as “Ungrouped”, and folders/records are retained). Dragging the title allows reordering workspaces.
- General Settings adds a Context Compaction Threshold (17%–90%): when the conversation context reaches the set percentage of the model window (1M tokens), auto-compaction is triggered, retaining the most recent 16% of the original text each time. Saving takes effect immediately and is persisted. It takes effect uniformly for all Agent presets via the
agent/pre-stephook and remains valid after restart (GET|POST /compaction-threshold).
Other Changes in v0.4.1 vs. Upstream¶
- Confirmations and alerts are unified to the Modal from
@deepseek-ai/dsh-client-ui-primitives, replacingwindow.confirm/window.alert. - Fixed an issue where the plugin remount caused
webServer.register()to register duplicates, leading to host startup failure (process-level routing table takes over old registrations).
Installation and Enablement¶
The plugin reads and writes sessions and storage under ~/.dsh with the permissions of the current dsh process. It is recommended to review the source code and MIT license on GitHub before installation. After installation, a restart of dsh web is required (host and client bundle need to be reloaded).
From Release (Recommended)¶
dsh plugin --profile <profile> add https://github.com/JeffKeeping/dsh-session-manager/releases/latest/download/dsh-session-manager.tgz
You can also download dsh-session-manager.tgz first and then install locally:
dsh plugin --profile <profile> add /absolute/path/to/dsh-session-manager.tgz
Local directory installation uses the link method; do not move or delete the directory after installation.
From GitHub Specific Version¶
dsh plugin --profile <profile> add 'github:JeffKeeping/dsh-session-manager#v0.4.1'
From Local Directory (Example profile is web)¶
dsh plugin --profile web add /absolute/path/to/dsh-session-manager
Typical Usage¶
Centralized Management via Settings Page¶
- Open Settings (gear icon) at the bottom of the sidebar.
- Enter the Session Management section.
- The main list shows unarchived sessions; expand Archived Sessions at the bottom to restore or delete them.
- Deleting a session moves it to the Trash; within the trash, you can restore, permanently delete, or use Empty Trash to clear everything permanently at once.
- Inline actions: Resume Session, Pause (when running), Statistics, Folder, Delete; the top supports select all and bulk delete.
- Drag workspace titles to adjust order; hover over workspace titles to pin, rename, or delete workspace groups.
General Settings: Compaction Threshold¶
- Settings → General Settings (General).
- Adjust the “Context Compaction Threshold” slider or input box (17%–90%). It takes effect immediately upon saving.
Sidebar Deletion and Force Delete¶
- Hover over the “…” on a session row → Delete Conversation.
- Confirm in the native confirmation box to move it to the trash.
- If the host returns an error, select Force Delete in the same popup (still goes to trash, unless the session is currently running).
Conversation Top Drawer¶
Open the right-side drawer from Conversation Management. Inline More contains statistics, folder, and resume in new chat; the bottom also allows managing archived and trashed sessions.
Applicable Scenarios and Notes¶
Who it is for: Developers who maintain multiple workspaces and sessions in DSH Web for long periods; those who need recoverable deletion, archive restoration, activity statistics, global compaction thresholds, or need to clean up non-standard session IDs / orphaned child agent sessions.
Compatibility: The README states this version is verified on DSH 0.2.1-rc.2 (Desktop); upstream previously declared compatibility with 0.1.1-rc.1 and 0.2.0-rc.2. If DSH upgrades and slots or ctx APIs change, the plugin may require synchronous adaptation.
Limitation Summary:
- Cannot delete sessions that are currently thinking; for multi-tab usage, please ensure the session has stopped first.
- After a live session is deleted, memory state relies on DSH restart for cleanup; permanently deleted IDs are written to browser localStorage to prevent the list from “reviving” after a refresh.
- The plugin does not modify the harness core; the community directory SkillHub is an independent site and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-session-manager integrates common session lifecycle operations—deletion, recovery, archive restoration, statistics, run control, and workspace organization—into the native DSH UI. Version v0.4.1 adds force delete, empty trash, and remount stability improvements. If you are already using DSH Web for daily development, you can integrate it via the installation commands above and start using it from “Session Management” in the settings page or “Conversation Management” at the top of the conversation.
- Plugin Directory: https://www.skillhub.cn/plugins/JeffKeeping/dsh-session-manager
- GitHub: https://github.com/JeffKeeping/dsh-session-manager