Khorsheed/dsh-plugins--packages-context-guard ↗★ 0

@khorsheed/dsh-context-guard

在上下文占用过高时提供压缩提醒按钮 适合需要防止请求超出模型上下文窗口限制的重度对话任务。

套件
@khorsheed/dsh-context-guard
相容性
待驗證
Harness 依賴範圍
^0.1.0-rc.6
Cordis 依賴範圍
^4.0.1
版本
0.2.3
授權
MIT
最近更新
2026年9月28日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Khorsheed/dsh-plugins#548eeabe331c121621b2d08deab4278ad81d6312&path:packages/context-guard

配置

一个可调项,在 GUI 里改且实时生效,无需重启——0.1.5:设置 → 插件配置 →「压缩提醒时机 / Compaction reminder timing」;0.1.6-alpha.2 起:插件管理页 → 本包详情页的配置区。

键默认值含义
thresholdRatio0.8压缩按钮出现时的上下文占用比例(限制在 (0, 1])。想更早收到提醒就调低——provider 拒绝墙在 100% 占用之下(见「实现原理」)。
plugins:
  context-guard:
    thresholdRatio: 0.65

该字段只影响按钮出现的时机——真实压缩时机仍由官方压缩引擎自己的 thresholdRatio / auto 配置决定。