Introduction¶
In the DeepSeek Harness (DSH) web or desktop interface, it is frequent to switch back and forth between multiple sessions: comparing with another conversation, or going back to the recently opened one to continue writing. The DSH frontend uses SessionReference for reference counting by default—every switch triggers a release() for the previous session, clearing historical windows in memory, assembly trees, and image preview URLs; switching back requires going through session.follow again, re-folding the assembly history, and redoing scroll positions and already fetched older messages.
dsh-session-history-cache (package name @local/dsh-session-history-cache) is a DSH plugin released by community maintainer TideDra, categorized as a “Memory” capability: using an LRU strategy in the frontend to retain recently accessed session references, aiming for request-free and instant opening when switching back to opened sessions. Below is an introduction to its positioning, behavior, installation, and configuration.
What is it¶
The plugin’s full name is DSH Session History Cache, targeting DSH Web UI (where dsh.client.platform in package.json is web), using a separate reference source sessionHistoryCache in the background to retain recently accessed non-empty sessions based on LRU (Least Recently Used).
- Maintainer: TideDra
- Repository: github.com/TideDra/dsh-session-history-cache
- Community Directory: SkillHub Plugin Page (independent site, not DeepSeek / HF official app store)
- License: MIT
- Current Version (
package.json): 1.0.1
It does not register extra Tools or slash commands with the Large Model; it is a pure frontend UI enhancement that does not add Prompt Token overhead.
Core Features¶
Difference from Default Behavior¶
Before installation: switching sessions in the sidebar immediately releases the previous session reference, destroying related memory structures after zeroing out.
After installation: except for the current main view, the cache layer continues to hold references to recently accessed sessions until evicted by LRU or a release condition is triggered.
Verified Capabilities¶
- Zero-wait switching: Switching back to a visited session requires no re-request of
session.followor re-calculation of the conversation tree (BoundConversation). - State retention: Earlier history already loaded via pagination, chat scroll position, image Blob URLs, and background real-time stream increments remain in memory (assuming they haven’t been reclaimed).
- Auto-recycle and isolation: When exceeding the capacity limit, release the background session with the longest access time; empty new sessions do not occupy cache quota; release references immediately when session is archived, removed, or opening fails.
- Subagent Sessions (Configurable): By default, simultaneously cache Subagent sessions (
cacheSubagents, defaulttrue). - Settings Interface: In DSH bottom left Settings → General Settings → Cache Session History, view cached count, adjust capacity, and release all background cache with one click.
By default, aside from the current main view, a maximum of 10 recently accessed sessions are retained in the background.
Installation and Activation¶
Environment requirements (from package.json): Node >=20, DSH >=0.2.0-rc.1 <0.3.0-0.
Can install to a specific profile (example web) from GitHub:
dsh plugin --profile web add https://github.com/TideDra/dsh-session-history-cache.git -w
If source code directory already exists locally, can install from path:
dsh plugin --profile web add /path/to/dsh-session-history-cache -w
After installation and enabling, the plugin takes effect automatically without extra slash commands. The plugin runs on the client with the current DSH process permissions; browsing the repository source code and MIT license terms is recommended before installation.
Usage and Configuration¶
UI Operations¶
After opening Settings → General Settings → Cache Session History:
- View the current number of cached background sessions (e.g., “Currently cached 3 / 10 in background”);
- Adjust max capacity: “Disable Cache (0)”, “5”, “10”, “20”, “30”, “50”, persisted by DSH native Settings service;
- Click Release Cache: release memory references of all background sessions, affecting the currently viewed main session.
Cordis Configuration Options¶
The plugin declares volatile fields in the Cordis Config Schema, and can also be manually written in cordis.patch.yml:
| Field | Type | Default | Description |
|---|---|---|---|
enabled |
boolean |
true |
Whether to enable session history LRU caching |
maxCachedSessions |
integer (0–50) |
10 |
Maximum number of sessions retained in the background, excluding the current main view |
cacheSubagents |
boolean |
true |
Whether to cache viewed Subagent sessions simultaneously |
Setting maxCachedSessions to 0 is equivalent to disabling the cache.
Suitable Scenarios and Notes¶
Suitable for: Developers or daily users who frequently switch between multiple sessions and multiple Subagents in DSH Web / Desktop shell and wish to preserve scroll positions, loaded history, and image preview states.
Notes:
- The cache consumes browser (client) memory; the higher the capacity and the longer the session history, the higher the usage; you can lower
maxCachedSessionsbased on machine specs or use “Release Cache”. - It only alleviates the reload issue of “switching back to a visited session”; it cannot replace server-side session data; archiving, deletion, or errors will still trigger release.
- Depends on DSH 0.2.x RC series versions and the listed client injection modules; please check the
engines.dshrange inpackage.jsonbefore upgrading the DSH major version.
Conclusion¶
dsh-session-history-cache uses a frontend LRU reference to keep sessions alive, filling in the experience of DSH’s default “release everything on switch”, reducing session.follow and tree re-calculation during parallel multi-session work, while maintaining zero Tool and zero Token overhead. For installation instructions and issue feedback, please refer to the GitHub README or SkillHub Directory Page.