dsh-codex-context
按令牌预算管理上下文窗口,并支持冷历史检索 适合长会话需控制上下文开销的用户,可替换默认压缩后端。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dvaJi/dsh-codex-context说明文档
阅读完整 README ↗Configuration
Everything is a config field; all values are optional (schema defaults shown). Add a config: block to the bundle row (codex-context) in your profile's cordis.patch.yml — a patch replaces the row's whole config, so restate every key you care about.
| Field | Default | Meaning |
|---|---|---|
auto | true | Automatic windowing (agent/pre-step pressure) and overflow recovery (agent/request-error). |
targetActiveTokens | 35000 | Token budget for the active window; the backwards walk shadows older nodes until the tail fits. When the routed model's context window is smaller than targetActiveTokens / emergencyThresholdRatio, the effective budget is capped at emergencyThresholdRatio × contextWindow so windowing runs pre-emptively instead of waiting for an overflow. |
minRetainedNodes | 6 | Recent surface nodes always retained verbatim. |
maxExcerptLength | 1000 | Character budget per match-centered search excerpt. |
searchDefaultLimit | 3 | search_history result cap when the model omits limit. |
searchMaxScanEvents | 20000 | Safety cap on log events scanned per search call. |
emergencyThresholdRatio | 0.85 | Pressure fraction of the context window above which the engine writes a real model summary (the parachute). |
emergencySummarization | true | Master switch for the parachute; false keeps windowing model-free at all times. |
summarizationProvider / summarizationModel | '' | Fixed route for the emergency summarizer; empty uses the routed request target, then AgentOptions. Configure both as a pair (both empty or both set) or the plugin refuses to load. |
emergencyMaxTokens | 8192 | Output cap for the emergency summarization request. |
maxOverflowRetries | 1 | Extra windowing attempts after a provider-confirmed context overflow. |
notesHint | hint text | Line appended under the pinned notes snapshot; empty disables it. |
retrievalHint | hint text | Guidance sentence embedded in every window checkpoint. |
Invalid values (ratios outside (0, 1], non-positive budgets) fail the plugin at load.