AI Agent Hub
Back to plugins
🧠

dsh-better-chat-history

Memory Updated 2026.08.15

Run the following command in DeepSeek Harness:

dsh plugin install echo-xianyu/dsh-better-chat-history

Paste the following prompt into your AI chat to install this plugin:

Install by running dsh plugin install echo-xianyu/dsh-better-chat-history in the DeepSeek Harness terminal; source at https://github.com/echo-xianyu/dsh-better-chat-history

About this plugin

In DSh multi-agent workflows, session logs are stored as JSONL files. Every session switch, GUI cold start, or list refresh triggers a full file read; frequent projection-cache put/delete cycles amplify fsync calls and wear down SSDs. dsh-better-chat-history wraps DSh's existing service instances with zero dependencies and pure JS ESM, taking over both read and write paths silently without modifying the DSh core.

The read path introduces a three-level cache: the inspect layer uses a 64-slot LRU with concurrent deduplication so each id is read from disk only once; the readFrom layer serves slices from memory on a hit with zero disk IO; the list layer uses a 5-second TTL to avoid full header scans on every GUI refresh. On startup, a background warmer pre-loads roughly 24 recently active sessions into the cache so even the first click hits memory. The write path coalesces fail-soft projection-cache updates into a 1.5-second window, cutting fsync frequency by about 10x, while authoritative data like workspace.json is still written through unchanged. All cache sizes, TTLs, and warmup parameters are configurable via the profile patch.

Ideal for DSh users who frequently switch between multiple agent sessions, are sensitive to SSD write amplification, or simply want faster session loading without touching DSh source code. The plugin runs silently in normal operation, and its effect is observable behaviorally without any extra monitoring overhead.

Use Cases

  • Eliminate full JSONL cold reads when switching between agent sessions
  • Reduce repeated fsync on projection cache to lower SSD wear
  • Hit pre-warmed cache on first session open to avoid load stalls

Best For

  • Developers running DSh multi-agent workflows daily
  • Users sensitive to SSD write amplification or extending drive lifespan
  • Users who want faster session loading without modifying DSh source code