Introduction

The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When using @ in the Web UI to trigger session candidates, the official DSH engine fully decompresses and parses session.jsonl.zstd line by line for each persisted session to obtain the latest title. As the number of sessions grows, every keystroke requires scanning large amounts of logs, and the caching mechanism (an LRU cache that stores only 5 entries) struggles to handle high-frequency queries. dsh-title-index aims to resolve this performance bottleneck through a disk-based index.

What It Is

This is a plugin that adds a disk index to session title reading for the dsh Web UI. It was developed by maintainer gtaifu and follows the MIT License.

Core Features

Replaces the official line
It disables the official session-query-sqlite line and injects a new line through cordis.patch.yml, introducing a service named dsh-title-index. The plugin extends the official SqliteSessionQueryEngine class, overriding only the readTitleSnapshots method. Other behaviors, such as listSessions and search, remain using the official implementation.

Indexing mechanism
The plugin maintains an index file on disk (default: <DSH_HOME>/title-index.json), using (sessionId, mtimeMs, size) as invalidation keys. On an index hit, it directly returns the cached title snapshot. On a miss (for a new session or after log appends), it uses the official folding logic and writes the result back to the index.

Automatic invalidation and refolding
When a title-generation plugin rewrites the logs and the file mtime changes, the index is automatically invalidated, and the data is refolded on the next query.

Fallback strategy
For active sessions, official read failures, or corrupted indexes, the plugin falls back to the official path unchanged, avoiding any degradation in user experience.

Measured performance
In an environment with approximately 60 MB of zstd logs across 114 sessions, the Top-50 @ menu title reading time was reduced from about 9.7 seconds with the official implementation to about 0.3 seconds.

Installation and Enablement

  1. Install the plugin
    Run under the Web profile:
    dsh plugin --profile web install
  1. Configure dependencies and bundles
    Add the dependency to the profile’s package.json and configure it in dsh.profile.bundles. dsh-title-index must be placed after @deepseek-ai/dsh-web-app to ensure the patch takes effect after the official line definition.
    {
      "dsh": {
        "profile": {
          "bundles": [
            "@deepseek-ai/dsh-base",
            "@deepseek-ai/dsh-web-app",
            "dsh-title-index"
          ]
        }
      },
      "dependencies": {
        "dsh-title-index": "github:gtaifu/dsh-title-index"
      }
    }
  1. Warm up the index
    The first cold start performs a full fold once to populate the index. You can complete this in advance using the warm-up command:
    node <profile>/node_modules/dsh-title-index/lib/bench.mjs

Notes

  • Deprecated: This plugin is currently marked as deprecated. DeepSeek Harness 0.1.2rc now includes a built-in implementation of a faster @ function.
  • Cold-start time: A cold start (when the index is missing or after a format upgrade) takes about 8–9 seconds.
  • Dependency on internal behavior: The plugin relies on internal implementation details of the official engine.

Conclusion

By introducing a disk-based index mechanism, dsh-title-index significantly reduces the overhead of session title queries in the Web UI. This functionality has now been integrated into the official DSH version. The community catalog and GitHub repository still retain this plugin as a reference implementation.

GitHub | Community Catalog