Introduction

The design philosophy of DeepSeek Harness (DSH) is “Everything is a plugin.” During development, managing, viewing, and cleaning up session history are frequent needs. dsh-session-manager is a plugin maintained by huajuan2024. It provides a session management panel on the Web UI’s “Settings → Plugins” page. The plugin belongs to the “Memory” category and is designed to solve pain points such as viewing historical messages, deleting old sessions, and exporting session records.

Core Features

The plugin mainly consists of two parts: the Host service and the Web client. The Host process handles the core logic, reads sessions through the ctx.sessionManager and ctx.sessionQuery services, performs deletion and format conversion, and handles file operations. The Web client calls the Host via standard /api RPC calls and renders the session list and detail panel.

Specific capabilities include:
1. List Sessions: Lists all known sessions, including information such as title, cwd, updatedAt, turns, steps, and agentPreset.
2. View History: Clicking a single session allows you to view its message history. It supports exporting as JSON or Markdown.
3. Delete Sessions: Supports deleting a single session, but running sessions are rejected for deletion.
4. Export Functionality: Export operations use a browser Blob URL to trigger the download.

Installation and Configuration

Installation requires using the official tarball package. Ensure that Node.js 22.19 or higher is installed, as well as a version compatible with DSH 0.1.0-rc.7.

Run the installation command:

dsh plugin --profile web add ../../plugin-releases/dsh-session-manager-0.1.5.tgz

After installation, cordis.patch.yml within the package provides the default configuration. If you need to override the configuration, write the configuration in ~/.dsh/profiles/web/cordis.patch.yml using the same id. Note: When overriding, you must use a list to replace the entire config; you cannot append it after [].

Check the final configuration result:

dsh --profile web --dump-config

Typical Usage

  1. View the List: After starting the Web profile, go to “Settings → Plugins,” and you can see the “Session Management” panel listing all sessions.
  2. View Details: Click a session row in the list to expand and view the message history (by default, up to 200 messages are previewed).
  3. Export Data: Click the export button, and the browser will download the file in JSON or Markdown format.
  4. Clean Up Sessions: Click the delete button and delete the session in the confirmation dialog.

Notes and Limitations

Before using this plugin, be sure to check the source code and license. The plugin runs with the permissions of the current dsh process and involves file operations.

  1. Permissions and Security: File operations are performed only within the Host process. Tokens or absolute file paths do not enter Remote return values, preventing information leakage. sessionId must be a bare UUID or match the session-<uuid> format; other formats are rejected to prevent path traversal.
  2. Runtime Restrictions: Sessions in the running state cannot be deleted; the session must be ended first.
  3. Export Restrictions: The byte limit for a single export is 10485760 (10 MiB). Exceeding this size returns a too-large error.
  4. Troubleshooting:
    - session-running: The session is running and cannot be deleted.
    - not-found: The session directory no longer exists.
    - invalid-session-id: The Session ID format is incorrect.
    - permission-denied: The Host process does not have read/write permissions.
    - upstream-error: File extraction or parsing failed.

Summary

dsh-session-manager provides DeepSeek Harness users with the ability to manage session history directly from the Web interface. Through listing, viewing, exporting, and deleting, it helps developers better maintain and utilize session data. For more details and the source code, refer to its GitHub repository and SkillHub directory.