/compact and auto-compaction summarize with the model selected in the session, not the model that finished the last turn.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-compact-selected-model
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:DenAbr/dsh-compact-selected-model
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
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
Links
More in this category
ranxianglei/billion-context★ 8809
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Minglink/dsh-infinite-gen-4★ 4865
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 911
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
ECNU/EduWork#dsh-side-chat★ 441
Open temporary side conversations from a message with a snapshot of its history, then archive them on close; optional annotation integration adds selection-based questions. Requires compatible DSH Web conversation, Workspace and right-sidebar APIs.
MichengAI/dsh-archive-manager★ 410
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 335
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.