Introduction¶
DeepSeek Harness (DSH) allows developers to extend functionality through plugins. When debugging or optimizing an agent, you often need to quickly locate a specific snippet or context within past conversations. However, DSH does not provide a built-in local message search capability. While a few community-made session search plugins exist, they tend to overlap in functionality and can easily cause conflicts over sidebar slots, keyboard shortcuts, and routing. dsh-message-quick-search offers a standalone search solution: it adds one entry point in the sidebar and another in the session title bar, letting you search for exact text across all local conversation history by keyword.
Plugin Overview¶
This is an unofficial DSH community plugin developed by maintainer Takinan. It reads session files locally only — no network calls, no data upload. It adds historical message search to the DSH client and also provides a search_history tool for the Agent.
Core Features¶
Two UI Entry Points¶
The plugin registers two entry points in the DSH client. Both are enabled by default and can be toggled off in the configuration:
- Sidebar — “Search History”: A full-width row button that opens a full-page search view.
- Session title bar, top-right (to the left of the automation task icon): A magnifying-glass button that opens a dropdown overlay.
Three Search Scopes¶
- Current session: Searches only the session currently in view.
- All sessions: Searches every local conversation history.
- Selected sessions: Multi-select from a list displayed by session title + workspace name.
Full-Text Card¶
Clicking “Show Full Text” on any hit opens a card displaying the original message. Within the card, you can navigate with “Previous / Next” to page through the surrounding context, or “Copy” the content. “Previous / Next” automatically skips messages that contain only tool calls with no body text.
Agent Tool¶
The plugin exposes a search_history(query, limit?, days?, workspace?, include_reasoning?) tool to the Agent, returning matched snippets and session IDs. The Agent can use this tool to retrieve context from local history, sharing the same search logic as the UI.
Installation & Activation¶
Install via the plugin manager on DSH’s plugin page:
plugin_manager install_bundle target="https://github.com/Takinan/dsh-message-quick-search"
Or clone it locally first, then point to that directory:
{ "action": "install_bundle", "target": "D:/path/to/dsh-message-quick-search" }
After installation, restart the DSH client: plugin code is loaded at startup and only supports host-side hot-reload.
⚠️ Do not enable this plugin alongside other session-search plugins. For example,
@lizimin/dsh-session-searchregisters the same sidebar slot, shortcuts, routes, and tool names — running both simultaneously will likely cause conflicts.
Configuration¶
Edit the cordis.patch.yml file in the DSH installation directory and add the following:
config:
headerButton: true # The button in the top-right of the title bar
sidebarRow: true # The sidebar row + full search page
debug: false # Diagnostic output; enable only when troubleshooting
Save the file and restart DSH for changes to take effect.
Typical Usage¶
- Click “Search History” in the sidebar, or the magnifying-glass icon in the session title bar.
- Type a keyword; results appear automatically after ~300 ms. Press Enter to search immediately.
- Switch between “Current Session / All Sessions / Selected Sessions” to narrow the scope.
- Click “Show Full Text” to view the complete message, then use “Previous / Next” to navigate the surrounding context.
How It Works¶
Data Source¶
The plugin reads %USERPROFILE%\.dsh\sessions\<workspace-id>\<session-id>\session.v4.jsonl.zstd files. This file uses a “multi-frame zstd” format where each appended entry is compressed as a separate frame. Node’s zstdDecompressSync only decodes the first frame, so the plugin splits the stream by the magic number 28 B5 2F FD, decompresses each frame individually, and concatenates the results. Decompressed output is cached by (size, mtime) so the same file is never decompressed twice.
What Content Is Indexed¶
Only text blocks from user/message and assistant/message entries are indexed. Two filters apply:
reasoning(chain-of-thought) is excluded by default; it can be explicitly enabled when needed.- In
user/messageentries, any withdata.source.kind !== 'user'are hidden context injected by DSH each turn (e.g.,Time sampled while preparing turn N…). These must be skipped, otherwise the search would surface “messages” that no user actually sent.
Host Routes¶
The plugin registers four routes on the host side (browser-side paths are document-relative):
| Route | Purpose |
|---|---|
api/history-search.config |
Returns the three toggle flags |
api/history-search.query |
Performs search; scope=current\|all\|custom |
api/history-search.sessions |
Returns the most recent 60 sessions (with title and workspace display name) |
api/history-search.message |
Fetches a single message by session + seq, along with its preceding/following seq |
All routes go through DSH’s own authentication channel (ctx.connection.fetch.register), so only locally authenticated pages can call them.
Known Limitations¶
- Cannot “scroll to that message.” DSH’s chat area uses a virtualized list; unloaded history is not in the DOM, and there is no public API to jump to a specific event. The plugin uses a full-text card popup instead — this is a product decision, not a temporary workaround.
- Only covers sessions already persisted to disk; the turn currently in progress may not yet be written to the file.
- Text-only search: images, attachments, and structured tool output are not part of the matching.
- Time filtering uses the
timefield within each record, not the file mtime (short sessions would cause cross-contamination).
Compatibility¶
- Developed against DSH 0.2.2-rc.5 (desktop edition), using
ctx.connection.fetch.register,ctx.slots, andctx.tools.register. These APIs may change between DSH versions; cross-major-version compatibility is not guaranteed. - No third-party dependencies and no build step required.
Development¶
Project structure:
index.js Host: search logic, four routes, agent tool
client.js Client: two entry points, search UI, full-text card
cordis.patch.yml Package patch: inserts the plugin row and toggles
locale/*.json Title and description for the plugin management page
After making code changes, restart DSH to see the effect. client.js is plain JS registered directly via window.__ModuleLoader__.load — no bundling step involved.
Code conventions: each file’s header comment must clearly state “purpose / author / date / what the code does / input & output parameters / error code meanings.” Change logs go below the header comment, one line per entry, never overwriting previous entries.
License¶
MIT. © 2026 Takinan