DoctorxPriestess/dsh-cache-safe-tool-result ↗★ 0

dsh-cache-safe-tool-result

Keep DSH tool results cache-prefix safe: truncate a result before it first enters the session surface, and never rewrite a tool result a provider request has already delivered. 适合出现超长工具输出污染上下文的环境,需配置阈值后方可生效。

Package
dsh-cache-safe-tool-result
Compatibility
Unverified
Version
1.0.0
License
MIT
Last updated
Sep 20, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:DoctorxPriestess/dsh-cache-safe-tool-result

Configuration

keydefaultmeaning
thresholdChars8192truncate when the text exceeds this many code points
headChars4096leading code points retained
tailChars1024trailing code points retained
firstPasstruemount the pre-admission truncation listener
guardedPrunertrueprovide the delivery-guarded toolResultPruner
includeNestedtruefirst-pass: also truncate sub-dispatch results
verbosefalselog per-truncation and per-pass detail

thresholdChars, headChars and tailChars match the built-in pruner's defaults exactly, so the swap does not change how much context a session keeps. Configuration is validated: headChars + marker + tailChars must fit inside thresholdChars, and a non-integer or negative budget throws at mount time rather than silently misbehaving.