loonylabs-dev/dsh-cache-guard ↗★ 0
dsh-cache-guard
Host- and agent-layer DeepSeek Harness plugin that prices every automatic context rewrite before it lands, asks the human by default, and reports what the provider had to re-read cold. 适合需要监控和控制AI上下文重写Token消耗及费用的用户。
Install
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:loonylabs-dev/dsh-cache-guardREADME
Read the full README ↗Configuration
The host row governs. A preset row's config applies only where the host half is absent — an engine is wrapped once, by whoever gets there first, and the host plane always announces before a preset row applies.
| Key | Default | Meaning |
|---|---|---|
mode | manual | manual asks before an automatic surface change; auto only reports it; off leaves the operation to the engine as shipped |
pricePerMTokens | unset | full-price input rate per million tokens; adds a currency amount to the dialog and the pill |
estimatedSummaryTokens | 4000 | assumed checkpoint size used when pricing a planned summarization |
The trigger threshold belongs to the engine, not to the guard: it is the compaction-basic row's thresholdRatio (default 0.8, i.e. compact once 80% of the routed window is in use). The installer can set it — it patches that row's config in the generated preset, which is the whole of that row's config because a patch replaces rather than merges:
node tools/install-profile.mjs --threshold 0.9