Khorsheed/dsh-plugins--packages-context-guard ↗★ 0
@khorsheed/dsh-context-guard
Context-window compaction reminder: a compact button appears in the composer once context occupancy (the same number the context ring shows) crosses a configurable fraction of the model's context window, so you can compact before requests hit the provider's rejection wall (which sits below 100% occupancy because the request reserves output tokens) 适合需要防止请求超出模型上下文窗口限制的重度对话任务。
설치
$
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 起:插件管理页 → 本包详情页的配置区。
| 键 | 默认值 | 含义 |
|---|---|---|
thresholdRatio | 0.8 | 压缩按钮出现时的上下文占用比例(限制在 (0, 1])。想更早收到提醒就调低——provider 拒绝墙在 100% 占用之下(见「实现原理」)。 |
plugins:
context-guard:
thresholdRatio: 0.65
该字段只影响按钮出现的时机——真实压缩时机仍由官方压缩引擎自己的 thresholdRatio / auto 配置决定。