dsh-session-search: Full-text Search and Message Location for DSH Session History

Introduction

Running long-term conversations in DeepSeek Harness (DSH) can lead to a pile-up of sessions locally. Finding a specific sentence from a past discussion often requires opening conversations one by one and scrolling up and down. While DSH has built-in indexing capabilities that can work with other plugins, if you simply want to search all history by keyword within the Web or Desktop sidebar and jump directly to the line containing that message, you need a plugin dedicated to reading local session files and performing the jump within the UI. Here, we introduce the community plugin dsh-session-search (Maintainer: Li-0803, Category: Memory).

What is this

dsh-session-search adds a Session Full-text Search Pop-up to DSH: It provides a magnifying glass entry point in the sidebar to search all historical sessions in the local DSH by keyword. Clicking a hit opens that session and locates the specific message line, highlighting it for a few seconds (User messages locate to the user line, DeepSeek replies locate to the assistant line).

Original description: Full-text search for DeepSeek Harness sessions with precise message navigation.

  • Directory Page: https://www.skillhub.cn/plugins/Li-0803/dsh-session-search
  • Source Code: https://github.com/Li-0803/dsh-session-search
  • License: MIT
  • Current Version (package.json): 0.1.1

The plugin runs with the permissions of the current DSH process and reads local session content; it is recommended to review the source code and license before installation.

Core Features

Search Pop-up & Interaction

  • A search entry point appears in the bottom left of the sidebar (near the “Settings” button); clicking it opens a pop-up, which can be closed via the top-left close button, clicking the overlay, or pressing Esc.
  • 300ms debounce for real-time searching after entering keywords in the search box.
  • Conversation Party Filter: All / DeepSeek / User.
  • Results are sorted by time in descending order, with each entry showing the time (MM-DD HH:mm).
  • When no keyword is entered, it defaults to listing all sessions (Title + one sample User / DeepSeek message for each).
  • Keyword highlighting for hit content, showing only the fragment near the hit sentence.
  • Click a hit → Open session → Auto-load history pagination → Locate message line → Scroll and highlight → Pop-up closes.

Host Side & Positioning Mechanism

The host side directly reads ${DSH_HOME:-~/.dsh}/sessions/**/session.jsonl.zstd, uses Node’s built-in node:zlib to decompress JSONL, and performs local full-text search; it does not rely on DSH’s session.search index, nor does it require changing session-query-sqlite’s openAt to startup.

Conversation pagination is lazy-loaded. The plugin loops through sessions.binding(sessionId).session.loadOlder() on the client side until the target message enters the DOM, then locates it using [data-chat-anchor-key] and text matching. Highlighting only applies to text nodes and does not rewrite innerHTML.

It exposes GET /api/dsh-session-search (parameters include q, party, etc.) via DSH’s ctx.webServer. The interface has a Loopback Restriction (only allows access if both Host and remoteAddress are localhost / 127.x / ::1, otherwise 403). The documentation explicitly states that this is not a reliable authentication; processes or pages on the same machine that can access this port may still be able to read session content.

Response Limits

  • Each hit snippet is capped at approximately 300 characters; excess is wrapped with … and marked truncated: true.
  • A single search is limited to a maximum of 200 hits (matchLimit) and 50 session groups (groupLimit); the list without keywords is also limited to the latest 50 sessions.
  • The keyword length is limited to 500 characters.

Environment Requirements

  • Node.js ≥ 22.15.0 (zstdDecompressSync is available starting from 22.15.0 and is an experimental API).
  • DeepSeek Harness: The README states it has been manually verified on dsh web 0.1.x (0.1.1-rc.2), the official Desktop (DSH Desktop), and dsh web 0.2+.
  • Browser: Latest versions of Chrome / Edge / Safari / Firefox.

The session switching API varies by DSH version: 0.2+ / Desktop uses uiWorkspace.openSession(sessionId); 0.1.x uses sessions.open(sessionId). The plugin prioritizes the new API and falls back to the old one.

Installation & Activation

It is recommended to use dsh plugin add (the repository includes dsh.bundle.patch, which can automatically insert the plugin into the profile during installation). The steps in the documentation are as follows (The plugin directory needs to be placed in a stable location first; the example assumes the directory name is dsh-session-search).

mkdir -p ~/.dsh/plugins
cp -R dsh-session-search ~/.dsh/plugins/

dsh plugin --profile web add link:~/.dsh/plugins/dsh-session-search

Fill in --profile based on the actual host: dsh web users generally use web, and the official Desktop uses desktop. Restart the corresponding host after installation to activate.

If pnpm install behaves abnormally with link: dependencies (manifesting as “Already up to date” but the package is missing in node_modules), you can add a symlink:

ln -snf ~/.dsh/plugins/dsh-session-search ~/.dsh/profiles/web/node_modules/dsh-session-search

If not relying on pnpm, you can manually symlink into the profile’s node_modules and restart. If the host does not recognize dsh.bundle.patch, you need to append the insert entry from the README to the end of ~/.dsh/profiles/<profile>/cordis.patch.yml.

Uninstallation: Delete the symlink, remove the corresponding insert from cordis.patch.yml, and restart; optionally delete ~/.dsh/plugins/dsh-session-search. The plugin does not write new data files.

Typical Usage

  1. Start or restart dsh web / DSH Desktop, and confirm that the search entry appears in the bottom left of the sidebar.
  2. Open the pop-up and enter a keyword; switch between “All / DeepSeek / User” if needed.
  3. Click a hit in the grouped results, wait for the session to open and history pagination to load; the page should scroll to the corresponding message and briefly highlight it.
  4. Clearing the keyword allows browsing the recent session list (subject to the 50 session limit).

Host-side unit tests (README):

node --test

Use Cases & Caveats

Suitable for: Developers who use DSH locally, have many sessions, and need cross-session full-text retrieval and jumping to the original message line.

Important Notes:

  • The plugin reads and displays the full text of all local historical sessions. It does not upload, telemeter, or initiate external network requests, but session content is usually highly private.
  • Do not expose DSH Web to the public internet or untrusted networks (e.g., avoid listening externally with --host 0.0.0.0); assess the risks yourself before use on shared computers.
  • Searching involves synchronous disk reading and decompression, which may cause a brief lag when there are many or large sessions; there is no cache index, so old requests may return later than new ones during continuous rapid input.
  • Positioning uses polling to wait for the DOM; waiting will be longer for very long sessions with targets near the beginning.
  • Loopback restrictions cannot replace access control; reverse proxies or port forwarding may alter the appearance of request sources.

Common issues (excerpts): No entry point → Check cordis.patch.yml and symlinks and restart; 403 → Non-loopback access; Cannot switch session → DSH version mismatch with openSession / sessions.open contract, see the README troubleshooting table.

Conclusion

dsh-session-search provides cross-session full-text search in the DSH sidebar and loads pagination and locates the specific message line after clicking a hit, making it suitable for quickly retrieving historical conversations in local Harness workflows. For details and updates, see the GitHub README; Community Directory Page: https://www.skillhub.cn/plugins/Li-0803/dsh-session-search , Source Code: https://github.com/Li-0803/dsh-session-search .

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye