Letter2025/dsh-tool-search3

dsh-tool-search

Tool search & slimming for DeepSeek Harness: Hermes-style progressive disclosure — search, describe, and call long-tail tools on demand while keeping core tools eager

AI Analysis

核心用途是优化工具加载,通过按需检索和动态注入长尾工具来节省上下文窗口。适合工具集庞大、需要精简核心工具上下文以提升模型响应效率的任务。

Package
dsh-tool-search
Version
0.1.3
Last updated
Aug 14, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Letter2025/dsh-tool-search

Configuration

Static tuning lives in your profile cordis.patch.yml (restart to change):

- id: tool-search
  config:
    enabled: auto        # auto | on | off
    thresholdPct: 5      # listing budget as % of context window
    listingMaxTokens: 4000
    configScope: auto    # user | project | auto (project file wins when present)
    core: [todo_write]   # extra always-eager tools
    maxWarmTools: 8      # LRU cap for dynamically injected tools

Tool groups, the matcher, and preload live in the runtime file (~/.dsh/dsh-tool-search.json for user scope):

{
  "version": 1,
  "scope": "user",
  "groups": [
    { "name": "git", "tools": ["git_status", "git_diff"] },
    { "name": "mcp-github", "prefixes": ["mcp_github_"] }
  ],
  "matcher": {
    "endpoint": "https://dashscope.aliyuncs.com/compatible-mode/v1/rerank",
    "apiKey": "sk-...",
    "model": "qwen3-reranker",
    "topN": 20
  },
  "preload": { "enabled": false, "topK": 5 },
  "core": ["read_file", "write_file"]
}
  • groups: exact tool names and/or name prefixes; a tool belongs to the first matching group.
  • matcher: an OpenAI-compatible /v1/rerank endpoint — the only matcher type. tool_search returns setup guidance until one is configured.
  • preload: optional; when enabled (with a matcher), the session's first turn semantically preloads the top-K matching tools into the eager set.
  • The file is watched by mtime and hot-reloads; changes take effect on the next turn.