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. 适合出现超长工具输出污染上下文的环境,需配置阈值后方可生效。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:DoctorxPriestess/dsh-cache-safe-tool-resultREADME
Read the full README ↗Configuration
| key | default | meaning |
|---|---|---|
thresholdChars | 8192 | truncate when the text exceeds this many code points |
headChars | 4096 | leading code points retained |
tailChars | 1024 | trailing code points retained |
firstPass | true | mount the pre-admission truncation listener |
guardedPruner | true | provide the delivery-guarded toolResultPruner |
includeNested | true | first-pass: also truncate sub-dispatch results |
verbose | false | log 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.