Preface¶
When mounting a batch of tools for agents in DeepSeek Harness (DSH), the default practice is often to stuff all tool JSON Schemas into the model’s prefill right at the start of the session. The more tools there are, the longer the prompt evaluation time before the first token, and the larger the chunk of the context window budget consumed before any actual work begins. Small models also have to “remember” dozens of unrelated tool constraints simultaneously, which increases the error rate.
Below is an introduction to the community plugin DSH Tool Router (maintainer residenthiago2011). It changes the approach from “exposing the entire toolset upfront” to “registering only one find_tool, and revealing the specific tool’s schema only when needed,” utilizing an independent decision model API (POST /v1/systemone) for selection. The plugin is categorized as a workflow; you can view its entry on the SkillHub directory page, and find source code and documentation in the GitHub repository.
What is this¶
DSH Tool Router (npm package name @local/dsh-tool-router, version 1.1.0 in current materials, license MIT) is designed for lazy-loading tool discovery in DSH: during the prefill stage, it does not send the schema of every mounted tool to the model, retaining only a smaller find_tool schema. When the model needs to call a tool, the routing plugin selects (or prompts with a short list of) exactly one tool via the decision interface, and then temporarily reveals its JSON Schema.
Compared to the DSH Standard preset, the README provides platform-reported comparisons for the “new session, first message” scenario (using the same measurement backend): Standard uses approximately 6,559 prefill tokens, a system prompt of about 5,816 characters, and upfront 26 tool schemas; the no-prefill preset with this plugin bundle enabled uses approximately 283 prefill tokens, a system prompt of about 372 characters, and upfront 1 schema (find_tool). The README also notes: if almost all tools are used later in the session, the gap will narrow; unused toolset halves will still be billed from the first sentence in the default configuration.
Core Features¶
Three-Stage Routing¶
The plugin registers find_tool in index.js and masks other tools by agent. The overall flow is divided into three stages (as described in the original source material):
- Stage 0 (Full Candidate Surface) — For each mounted tool (the README uses an example of ≤24 tools in the default Standard configuration), attach a criterion of about 160 characters and sort them lexicographically after removing stop words; the sorting is mainly used to constrain abnormally large mount scales.
- Stage 1 (Decision Request) — Send a
POST /v1/systemonerequest to the decision model API to get abestToolselection; there is also ausablefield used for telemetry only. The README states this takes approximately 235–500 tokens and 6–7 seconds on-device. - Stage 2 (Accept or Shortlist) — When
confidence >= 0.70, return the winning tool’s JSON Schema and reveal only this single tool; otherwise, return a short list sorted by probability, with the reason citing the closest match, allowing the model to retry with the exact tool name (or send an empty request to get the full catalog). If the request already contains an exact tool name, the decision call is skipped and the tool is revealed immediately.
Bundle Patch Content¶
When selecting the plugin bundle, cordis.patch.yml is applied, which mainly includes:
preset-no-prefill: An agent preset consisting only ofpersona+dsh-tool-router; the persona instructs the model to callfind_toolfirst, and if the result does not include a schema, to retry with the exact tool name or an empty request, rather than giving up immediately.- Enable specific host tool lines: Such as setting
tool-bash,tool-fs,tool-fs-search,tool-todo,tool-web, etc. todisabled: false, and insertingpresentlines; the discovery mechanism requires tools to exist on the host side, and registration within the preset scope shadows host-side items with the same name, without affecting other presets. Under the thin preset, the Agent Presets page mainly displays onlyfind_tool.
Companion Files¶
| File | Function |
|---|---|
index.js |
Registers find_tool, masks other tools, executes three-stage decision making |
cordis.patch.yml |
Preset declarations and host tool enablement |
tool-registry.json |
Stage 0 labels and Stage 1 criteria (README mentions 25 tools, including bash and other shells) |
The README also emphasizes: find_tool must be registered using a standard JSON Schema (type/properties/required/additionalProperties), otherwise the model may call it with {}.
Installation and Activation¶
Environment Requirements¶
- DSH 0.2.0-rc.2 or higher (requires support for the
dsh.bundle.patchbundles mechanism). - An accessible decision model API with the protocol
POST /v1/systemone. The default address ishttp://127.0.0.1:8081/v1/systemone; to change the host or port, you need to editROUTER_BASEinindex.js. - pnpm available in the PATH of the host running DSH (the plugin manager installs via pnpm, and the CLI forwards pnpm arguments).
Installation Commands¶
Install from GitHub (Recommended by README) — In Plugins → install → spec, fill in:
git+https://github.com/residenthiago2011/DSH-Tool-Router.git
Or use the CLI (replace <profile> with your profile name):
dsh plugin --profile <profile> add git+https://github.com/residenthiago2011/DSH-Tool-Router.git
From Pre-built Tarball — Download dsh-tool-router.tgz from Releases, then:
dsh plugin --profile <profile> add /path/to/dsh-tool-router.tgz
After installation, select the corresponding bundle on the Plugins page (enabled by default after installation); if HMR is not enabled for the profile, DSH needs to be restarted.
Uninstallation¶
Deselect or remove the bundle on the Plugins page; preset lines and host tool flips will be reverted with the patch, leaving other presets unchanged.
Typical Usage¶
After enabling the no-prefill bundle, the usage pattern on the agent side is defined by the persona, rather than directly seeing the whole row of tool schemas:
- The model calls
find_toolfirst, expressing “what capability it wants to use” in natural language or task description. - The routing plugin completes Stages 0–2; if the confidence is sufficient, it returns the schema of a single tool, and the model initiates the actual tool call according to that schema.
- If a short list or no schema is returned, according to the README: request again with the exact tool name from the short list, or send an empty request to get catalog hints; the exact tool name path skips the decision API and reveals the schema immediately.
For local verification, the repository provides test scripts (requires the decision endpoint at 127.0.0.1:8081 to pass e2e):
node router-import-test.mjs # Module structure (no external dependencies)
node rank-sim.mjs # Stage 0 sorting (depends on tool-registry.json)
node router-e2e-test.mjs # Full flow; expects output ALL_PASS
Use Cases and Notes¶
More Suitable For: Large tool sets where only a few tools are used per single conversation turn; caring about first-token latency and context budget; willing to deploy a SystemOne-style POST /v1/systemone decision service locally or within an internal network.
Costs to Accept: Every selection via find_tool (non-exact-tool-name fast path) adds one round trip to the decision API; the README gives a magnitude of several hundred tokens and seconds-level latency. Without a decision endpoint, Stage 1 cannot function as designed.
Security and Compliance: DSH plugins run with the current dsh process privileges. Before installation, please read the GitHub source code and the MIT license yourself, and confirm that ROUTER_BASE, the host tools enabled by the bundle, and the exposure scope of the decision service comply with your environment policies. Community directories like SkillHub have no official affiliation with DeepSeek / High-Flyer; the plugin source is subject to the maintainer’s repository.
Conclusion¶
DSH Tool Router replaces “stuffing 26 schemas into prefill first” with “one find_tool + on-demand revelation”. Under the Standard comparison recorded in the README, the first message prefill can drop from about 6.5k tokens to about 283 tokens, and hands tool selection over to the POST /v1/systemone decision chain. If you are building workflow-type tools on DSH and are slowed down by prefill, you can install the bundle using the commands above, and prepare the decision API and pnpm environment.