CooperZhuang/dsh-context-window ↗★ 0
dsh-context-window
DSH plugin: Codex-style context management — token-budget notice, model-facing new_context, and handoff reset instead of summary compaction.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CooperZhuang/dsh-context-window说明文档
阅读完整 README ↗配置
在挂载行或 profile 的 cordis.patch.yml 里写:
- id: context-window
name: 'dsh-context-window'
config:
enabled: true
resetMode: seam-region
noticeThresholds: [25, 50, 75]
effectiveContextWindowPercent: 95
autoCompactTokenLimitRatio: 0.9
fallbackBufferTokens: 8000
reminderThresholdTokens: 16000
bodyAfterPrefix: true
toolEnabled: true
toolName: new_context
| 字段 | 默认 | 说明 |
|---|---|---|
enabled | false | 总开关;关闭时插件不注册任何东西 |
resetMode | 'seam-region' | seam-region = 委托 compactRegion 替换整面;handoff = 未实现 |
noticeEnabled | true | 是否注入窗口提示 |
noticeThresholds | [25, 50, 75] | 消耗百分比阈值,每个窗口每档只发一次 |
effectiveContextWindowPercent | 95 | 可用窗口占比(对齐 Codex) |
autoCompactTokenLimitRatio | 0.9 | 对 configuredLimit 的硬钳制(对齐 Codex) |
configuredLimit | 未设 | 显式 token 上限,受上一行钳制 |
fallbackBufferTokens | 8000 | 阈值下为下一轮输出预留的空间 |
reminderThresholdTokens | 16000 | 剩余降到此值时发一次换窗预告 |
resetReminderTemplate | Codex 同款文案 | 必须含 {n_remaining} |
bodyAfterPrefix | true | 只对窗口基线之上的增长计费 |
toolEnabled / toolName | true / new_context | 模型可见的换窗工具 |
配置在加载时失败即报错:比例越界、resetMode 未知、模板缺占位符都会拒绝插件加载。