Preface¶
When running Agents in DSH (DeepSeek Harness), long sessions gradually fill up the context window: the model either gets passively truncated or relies on host-side hardcoded thresholds to force compression at some point, leaving developers unaware of “how much is currently used and how far from the limit.” If the compression timing is not synchronized with the current task, it may interrupt a reasoning cycle or inject additional chatter, disrupting conversational semantics.
dsh-context-pilot addresses this problem: it injects usage information into the prompt per turn, allowing the model to decide whether to compress via tool calls; compression takes effect before the next step begins, without interrupting the current turn, without injecting messages, and without fabricating user statements. It also provides optional intelligent thinking to inform the Agent of the current model’s thinking intensity level, allowing it to autonomously switch gears according to task difficulty (also via tools). The following sections describe the plugin’s positioning, capabilities, and installation/usage.
What Is This¶
- Repository: Shuffle-1992/dsh-context-pilot
- Maintainer: Shuffle-1992
- DSH Panel Name: “Context Intelligent Compression” (previously “Context Pilot”)
- Community Category: Model Reasoning (SkillHub directory page: dsh-context-pilot)
- Current Version:
v0.1.61(root directorypackage.json) - License: MIT
The plugin is a DSH host-side bundle, mounted via dsh.bundle.patch in package.json pointing to plugin/cordis.patch.yml; DSH restart is required after installation. The project does not distribute npm packages (installations from 2026-10-10 onward use GitHub repository specifications only).
Core Features¶
Context Usage and Compression Decision¶
Each turn injects the current context usage into the Agent (limit, used, percentage, etc.; specific text can be configured via the panel template, or built-in text is used if left blank). When usage reaches the intelligent compression line, the model can call compression-related tools to decide whether to compress, and auto-continue if needed; when usage reaches the forced compression line, the plugin unconditionally initiates compression at pre-step (execution path is consistent with the intelligent path: first self-calculate the retention range, then official overflow fallback/conclusion).
Compression is triggered by tools and completed before the next step begins, without interrupting the current conversation turn, and without injecting additional messages or fabricating user statements in the current turn.
Panel and Configurable Options (Selected)¶
Contents that can be adjusted and observed in the configuration card (Web profile) include (subject to README / meta.description):
- Threshold margin, intelligent/forced compression lines and their upper limit relationships (effective forced line = min(user setting, upper limit); the upper limit is linked to the engine threshold and margin, changing the margin recalculates the upper limit in real-time).
- Three-tier retention ratios (live, effective in the next turn after modification, no restart needed).
- Text templates: such as
tplBrief,tplCard,tplEffBrief, etc.; built-in text is used if left blank; templates missing required placeholders will fall back to built-in and leave a trace. - Read-only information related to current turn injection, forced compression cooling, etc. (see
docs/in the repository for details).
Intelligent Thinking (Optional)¶
When enabled, exposes the current model’s thinking intensity level to the Agent, and allows it to autonomously switch gears via tools according to task difficulty; gear switching takes effect in the next step, tasks are not interrupted.
Installation and Activation¶
The host DSH version must satisfy what is declared in package.json:
"engines": {
"dsh": ">=0.2.0-rc.2 <0.3.0-0"
}
Install from GitHub (recommended and the only official distribution path):
dsh plugin --profile web add github:Shuffle-1992/dsh-context-pilot
Notes:
- The npm form
dsh plugin --profile web add dsh-context-pilotis not available for this project (no npm package). - Restart DSH after installation; bundle eligibility is declared by this package’s
dsh.bundle.patch.
For local development, you can link: the plugin/ directory into the profile’s dependencies, and add dsh-context-pilot to the profile’s dsh.profile.bundles; the plugin’s package.json must contain the dsh.bundle section, otherwise it may be silently skipped. See the repository’s docs/setup.md for details.
Typical Usage¶
- Install the plugin for the
webprofile using the command in the previous section and restart DSH. - Open the “Context Intelligent Compression” configuration card in DSH settings, set intelligent/forced compression lines, threshold margin, and retention ratios as needed; text templates can be left blank to use built-in descriptions.
- Normally converse with the Agent in multiple turns. The plugin injects usage and decision descriptions each turn; when approaching the intelligent compression line, the model decides whether to compress via tools; when reaching the forced line, the plugin executes compression at pre-step.
- If intelligent thinking is enabled, the model can adjust thinking intensity levels via tools when tasks become harder or easier.
The repository’s test/ contains contract / static / report / boot assertion suites; after modifying host-side logic, the document PANEL-HOWTO.md recommends toggle (off→on) or restart the plugin to load the new host behavior.
Suitable Scenarios and Notes¶
Suitable for: DSH users engaged in long coding, troubleshooting, multi-file Agent sessions who want transparent usage, compression timing aligned with task rhythm, and optional model-driven thinking intensity adjustment.
Notes:
- The plugin runs with current DSH process permissions; please read the GitHub source code and MIT license before installation, and evaluate whether to include it in your profile.
- SkillHub (skillhub.cn) is a community plugin directory, with no official affiliation with DeepSeek / 幻方; the DSH ecosystem philosophy is “everything is a plugin,” this plugin is one context management path, not the only solution.
- Configuration and behavior are subject to the repository README,
docs/, and current version; do not rely on npm package names not appearing in the documentation for installation.
Conclusion¶
dsh-context-pilot makes the context pressure of long sessions an observable and configurable panel capability, and hands over “when to compress, whether to switch thinking gear” to the model toolchain, with compression taking effect before the next step and without polluting the current conversation. For further understanding of design and version history, see the repository’s docs/ and docs/milestones.md.