Introduction

In the agent pipeline of DeepSeek Harness (DSH), models sometimes need to look back at session content that has already occurred, rather than constantly keeping the full history in the context. dsh-context-proxy provides a lightweight on-demand context retrieval capability: it exposes several read tools to the model, allowing callers to retrieve required content from persisted DSH history based on events, windows, or text snippets.

Below is an introduction to the positioning, core tools, installation methods, and usage considerations of dsh-context-proxy.

Plugin Positioning

dsh-context-proxy is a thin context retrieval plugin for DeepSeek Harness.

  • Maintainer: EvilIrving
  • License: MIT
  • One-sentence positioning: Thin on-demand context-retrieval layer for the DeepSeek Harness.

It primarily addresses the issue of “reading persisted history on demand,” providing three context retrieval tools to the model instead of requiring the caller to parse the full session logs themselves.

Core Tools

dsh-context-proxy provides three tools: context_query, context_slice, and context_grep.

Tool Depends on Backend Returns Content
context_query sessionQuery.filterEvents Lightweight matches, formatted as { seq, type, text }
context_slice sessionQuery.readEvent A single event, as well as limited before / after windows
context_grep subprocess-packaged rg, or sessionQuery.filterEvents Matches, formatted as { text, citation }

Several results come with reusable citations. These citations are replay-safe and take the following forms:

  • session:<seq>
  • path:line

In other words, the retrieval results are not just text; they also retain identifiers that can be used to locate them later.

Installation and Activation

If installing from a plugin source, you can use the following command:

dsh plugin --profile <name> add github:EvilIrving/dsh-context-proxy

If you already have a local checkout, you can also install from a local path:

dsh plugin --profile <name> add ./dsh-context-proxy

Here, <name> should be replaced with the actual DSH profile name being used.

Behavior After Activation

After installation, dsh-context-proxy registers three context tools to the model calls:

  1. context_query

Used to find matches based on existing fields. The return structure is:

{
  "seq": "seq",
  "type": "type",
  "text": "text"
}
  1. context_slice

Used to read a single event and return limited content before and after that event. Here, before and after are limited windows, not returning the entire history at once.

  1. context_grep

Used for text retrieval. It can call the packaged rg via subprocess, or fall back to sessionQuery.filterEvents. The return structure is:

{
  "text": "text",
  "citation": "citation"
}

Here, citation can be path:line or session:<seq>.

Dependencies and Fallbacks

dsh-context-proxy has a clear distinction for backend services:

  • sessionQuery is an optional service.
  • subprocess is an optional service.
  • tools is a hard dependency, marked as inject.

If the sessionQuery backend is missing, each tool will return an isError result instead of waiting indefinitely. This allows the caller to quickly see the reason for failure rather than getting stuck on an unavailable backend.

context_grep uses the packaged ripgrep from @vscode/ripgrep, so there is no need to install rg separately on the system.

Use Cases

dsh-context-proxy is suitable for the following DSH use cases:

  • Models need to read context from persisted session history based on events.
  • Callers need to obtain limited surrounding windows around a specific event rather than putting the entire history into the context at once.
  • Text retrieval is needed, and identifiers like session:<seq> or path:line must be preserved.

Considerations

When using dsh-context-proxy, it is recommended to clarify the following points first.

  1. The plugin runs with the current dsh process permissions

It is not a fully isolated external service. Before installation, you should check the source code and confirm that the license and usage comply with the project requirements. The license for this plugin is MIT.

  1. It reads context via seams

In the current plugin’s reading path, it does not write files but reads context only through seams. Related bundle writing is not sandboxed, so it should be understood within the scope of the current dsh process permissions.

  1. The line parsing format for context_grep is path:line:text

If the spill path contains newlines, it will interfere with parsing. The technical notes mention that absolute spill paths do not have this issue, but care should be taken regarding the parseability of the path itself when using custom paths.

  1. When no spill path is provided, the fallback text scan is literal, not regex

In other words, when context_grep has no available spill path, it falls back to the text scan of sessionQuery. This scan performs literal matching, not regular expression matching.

Links

  • GitHub: https://github.com/EvilIrving/dsh-context-proxy
  • Directory page link: https://www.skillhub.cn/plugins/EvilIrving/dsh-context-proxy