dsh-compact-selected-model
/compact 与自动压缩使用会话中当前选中的模型来生成摘要,而不是用跑完上一轮的那个模型。
安装
dsh plugin --profile web add dsh-compact-selected-model
沙箱测试结果
| 阶段 | 结果 |
|---|---|
| 1 安装 | ✓ |
| 2 列装 | ✓ |
| 3 挂载 | ✓ |
| 4 启动 | — |
四阶段在隔离沙箱里跑:安装(有网)→ 列装 → 挂载 → 启动(后三步断网)。
README
dsh-compact-selected-model
By default, DeepSeek Harness compacts a session with the model that answered the
last turn. If you switch models in the picker and then run /compact, the old
model still writes the summary. With this plugin, the summary is written by the
model you have selected now.
Works with dsh 0.1.7-rc.2 through 0.2.x.
Install
npx @deepseek-ai/dsh plugin --profile web add dsh-compact-selected-model
Then restart dsh web.
How it works
Picking a model in the web UI adds a model/selection event to the session.
That choice stays pending until the next request uses it. The plugin hooks
llm/stream. When a request has purpose: 'compaction' and the session has a
pending model, the plugin sends the request to that model. Nothing else in the
request changes.
The plugin leaves the request alone if compaction-basic has an explicit
summarizationModel set. Other requests are never touched.
If the selected model fails, for example because of a rate limit or a context
window that is too small, the compaction fails too. Switch back to a working
model and run /compact again.
Caveats
- The
compaction/summaryevent in the session log still names the old model,
because compaction-basic writes that record itself. The host log shows where
the request actually went.
- The auto-compaction threshold is still based on the context window of the
previous model.
- This needs the
modelSelectionprojection from the session controller, so it
does nothing in headless runs.
Development
node smoke.mjs runs an offline check against a stub LLM service.
License
MIT
以上内容来自 npm 上的 README,我们只做格式化,不改内容。
版本
npm 上共发布:2,最后更新 2026-10-11