xarleyn/dsh-plugins--plugins-dsh-tool-offload ↗★ 1
@yadsh/dsh-tool-offload
Offloads large, low-judgement DeepSeek Harness tool results to small one-shot worker agents before they enter the main model context 适合高频工具场景,要求子代理与工具白/黑名单已配置以减少上下文膨胀。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xarleyn/dsh-plugins#fd3cdd95651ec4eafe52d510751ba3aba3c9248d&path:plugins/dsh-tool-offloadREADME
Read the full README ↗Configuration
All keys are optional; defaults in parentheses.
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Master switch; false passes every result through untouched. |
routing.mode | allowlist | denylist | allowlist | allowlist offloads only routing.allow tools; denylist offloads everything except routing.deny. |
routing.allow | string[] | read, grep, search, web_fetch | Tool names matched exactly or by prefix* glob. |
routing.deny | string[] | bash | Tools never offloaded; wins over allow. |
routing.thresholds.minBytes | number | 24000 | Byte threshold; a result qualifies when either threshold is exceeded. |
routing.thresholds.minEstimatedTokens | number | 6000 | Cheap characters / 4 token estimate threshold. |
routing.rules | Rule[] | [] | Ordered rules; first match picks the worker/prompt profile or forces passthrough. Each rule: id, match.tools, match.minBytes, action (offload/passthrough), worker, prompt. |
workers | Record | — | Named worker profiles merged over the default profile. |
workers..subagentProvider | string | spawn | DSH subagent provider; must support tool restrictions. |
workers..provider / .model | string | null | null | Model route for the worker; null inherits the parent agent's route. Configure a cheap model here. |
workers..maxTokens | number | null | 4000 | Worker output token cap. |
workers..timeoutMs | number | 45000 | Bounded worker timeout; on timeout the original result is restored. |
defaultWorker | string | default | Worker profile used when no rule selects one. |
context.includeLastUserMessage | boolean | true | Pass the latest user task message to the worker. |
context.maxParentContextBytes | number | 12000 | Byte cap for the extracted parent task. |
payload.maxBytes | number | 300000 | Results larger than this pass through (chunking is planned). |
validation.maxOutputBytes | number | 20000 | Worker answers above this size are rejected. |
validation.requireReduction | boolean | true | Reject answers that did not actually shrink the result. |
validation.minReductionRatio | number | 0.15 | Required relative shrink (0.15 = at least 15 % smaller). |
fallback.mode | original | truncate | error | original | What replaces the result when an offload fails. |
annotation.enabled | boolean | false | Prefix transformed content with [offloaded result]. |
concurrency.maxWorkersPerAgent | number | 3 | Per-agent worker budget (non-blocking). |
concurrency.maxWorkersGlobal | number | 8 | Global worker budget (non-blocking). |
prompts | Record | — | Custom "Your job" prompt sections; generic, code-reader, search-results, web-reader, and logs are bundled. |
telemetry.enabled | boolean | true | Structured event logging; counters stay on either way. |
Built-in routing rules map the default tool candidates to bundled prompt
profiles: web_fetch → web-reader, grep/search → search-results,
read → code-reader; everything else uses generic.
Example cordis.patch.yml profile override:
- override:
- id: dsh-tool-offload
config:
workers:
default:
provider: zai
model: glm-4.5-air
maxTokens: 4000
routing:
allow:
- read
- grep
- web_fetch