In DeepSeek Harness (DSH) and similar agent environments, each llm/stream is a real upstream call. Concurrent sessions, parallel subagents, and repeated tool streams produce large numbers of requests with similar or even identical content. dsh-call-shrink intercepts these requests at the Stream layer and compresses N calls into 1 through caching, deduplication, and batch consolidation.
Plugin Overview¶
Name: dsh-call-shrink
One-liner: Compresses N LLM calls into 1 — the ultimate call-compression plugin for DeepSeek Harness (DSH).
Maintainer: zhuzichen362
License: MIT
Core Features¶
Extreme Merging
Window: 10 seconds · unlimited entries · no batch splitting · single output cap: 100 million tokens. The plugin collects independent requests within the window and merges them into a single upstream call.
Stable Fingerprint
Through normalized serialization (removing sessionId/signal/id/tool_call_id/source), it can match the same tool streams across sessions, ensuring cache and deduplication accuracy.
Protocol-based Merging
Uses [[TASK n]] / [[ANSWER n]] to delimit tasks and requires the model to output JSON-formatted responses. After successful parsing, the output is split back into N original streams in order; on parsing failure, it automatically falls back.
Failure Circuit Breaker
After 2 consecutive merge failures, the plugin automatically degrades to single-shot mode and resets after 10 seconds.
Real-time Panel
A “Call Compression” status dot appears in the session header, showing today’s usage/budget, single-shot and merged amortization, deduplication, cache hits, and the number of saved calls.
Usage Persistence
The daily budget is set to 500, and usage is recorded across restarts.
One-click Toggle/Reset
Operates state / session-stats / set-enabled / reset via host.call RPC.
Installation and Enablement¶
Use the official install command to add the plugin:
dsh plugin --profile web add dsh-call-shrink
After installation, restart dsh web. On desktop, ensure the built-in dsh is updated to 0.1.0-rc.6 or later. After restart, a “Call Compression” status dot appears in the session header.
Files and Configuration¶
Persistent Files
Cache and usage data are written to .dsh-shrink-cache. / .dsh-shrink-usage. in the working directory; these entries have been added to .gitignore.
RPC Operation Examples
// 开启/关闭插件
host.call('set-enabled', true)
// 查看状态
host.call('state')
// 查看会话统计
host.call('session-stats')
// 重置统计
host.call('reset')
Notes¶
- Batch merging changes the pattern of “each concurrent independent request makes one call”; the aggregated upstream output relies on the model following the protocol; parsing failures automatically fall back, so answers are not lost.
- Upstream calls are counted as 1/N amortized across each session participating in the merge.
- The plugin runs with the permissions of the current dsh process; check the source code and license before installation.