Preface¶
In long conversations, the first obstacle models often encounter is not the task itself, but the context window. As conversations grow longer, early file paths, decisions, and error messages will be silently discarded due to hard truncation. Another common practice is for the system to automatically summarize when the threshold is reached, but the model cannot see the generated summary. DeepSeek Harness (DSH) has a built-in automatic compression backend, with an approach similar to the latter: it replaces a segment of conversation with an automatically generated summary.
billion-context-dsh takes a different path. It turns compression into a tool callable by the model: the model decides when to compress, which segment to compress, and writes the summary itself. The automatic strategy only provides a nudge (reminder) and does not generate summaries on behalf of the model. The community catalog categorizes it under “Chat & Messages”. It should be noted that the DeepSeek Harness Plugin Library is an independent community site and has no official affiliation with DeepSeek / Hunyuan. The core philosophy of the official DSH repository is “everything is a plugin”, and this plugin is a community port, not a built-in item in the official app store.
This article is organized after cross-referencing the community catalog details page, GitHub repository README / docs/INSTALL.md / package.json, and the npm release page: what this plugin is, how to install and enable it, and what tools are available for the model side.
What It Is¶
billion-context-dsh is the CompactionEngine backend for DeepSeek Harness, implementing Active Context Pruning (ACP): it provides the model with a compress tool that allows the model to write a high-fidelity summary of a conversation segment, while retaining key details such as paths, decisions, and error messages, thereby reclaiming context space. The maintainer is Tyan66666. Both the repository and npm package use the MIT license, the main language is TypeScript, and Node.js ≥ 20 is required.
Do not confuse the ACP mentioned here with DSH’s official package @deepseek-ai/dsh-acp. The latter is an Agent Client Protocol bridge for clients such as editors; the ACP of this plugin comes from the design of “the model decides when and what to compress” from opencode-acp, the compression kernel is directly reused from acp-kernel, and the adaptation layer is ported from billion-context-pi (the same-named solution on the Pi coding agent proxy). The repository description states that the kernel and default behavior of the Pi version remain consistent, and the DSH adaptation layer (session event projection, persistent surface transactions, model tools, nudges, configuration) is the work of this repository.
The version is subject to the repository and npm. As of the query on 2026-08-17, both the GitHub package.json and the npm package are v0.2.2; the community catalog page still shows v0.1.7, and the star count is stuck at 11, while the GitHub repository has 20 stars. The catalog page is behind the times, so please refer to the repository README for installation and capability boundaries. Both the plugin and DSH itself are still in public beta, and the README clearly states: do not use them for engineering/production environments, and breaking changes are expected.
Core Features¶
Summaries Are Written by the Model Itself¶
The built-in automatic compression of DSH runs a separate summarization process and replaces a segment with the generated result. ACP does not do this: when the model calls compress, the summary is written immediately, without a second LLM summarization call. The repository frames this as a cost difference – the compressed content is the product of the current conversation model, not another silent summarizer.
Only Reminds, Never Presses the Compression Button for the Model¶
The pressure strategy injects nudges during agent/pre-step: efficiency prompts, context decomposition, compression rules, and a list of compressible ranges (surface seq). compactIfNeeded returns null, meaning the automatic path will not summarize on its own. Whether to call compress and which segment to compress is still up to the model. The engine defaults the nudge threshold for over-limit at ~70% usage, and the emergency nudge at ~85% usage, which is deliberately lower than the common 80% automatic compression threshold of the host’s compaction-basic, so that reminders appear first. The growth path can also trigger in the early to middle stage: when the pending tokens of a certain layer ≥ 50,000 and the growth compared to the last detection ≥ 22,500 tokens (there is no percentage lower limit for this rule). These thresholds come from the repository README and docs/INSTALL.md, not actual measured conversation data.
Compression Is Reversible, the Original Text Remains in the Log¶
Every model request in DSH is derived from the append-only conversation log (surface). compress implements a persistent surfaceOp: { op: 'replace' }: the summary written by the model becomes a checkpoint node, and the original text still remains in the log. Therefore, you can:
- decompress: Read-only restore the obscured original text
- search_context: Search for keywords in both chunk summaries and the original text
- Rebuild the chunk ledger from the log after restarting, without writing separate sidecar files
References use surface seq, and there is no need to tag each message with m00001 or similar labels. Range boundaries will automatically balance to tool-call / result pairing points, and seq with #callId fragments are also supported.
Four Model Tools Plus /acp¶
By default, four tools are registered in ctx.tools, and /acp is added to the command bar:
| Name | Function |
|---|---|
compress |
Replace a seq range with a summary written by the model; compressing the summary node of a chunk again is tiered distillation (tier 2/3) |
decompress |
Restore the original text by chunk |
search_context |
Search summaries and original text in compressed chunks |
acp_status |
View usage, compressed chunks, compressible ranges, and window source |
/acp |
Perform status / compress / decompress in the command bar |
Tiered distillation writes the tier and kernel chunk id into the log. After restarting, the kernel state can be rehydrated from the log and continue distillation. The /acp compress command in the command bar only performs ordinary T1 range compression; when encountering a summary node of an existing compressed chunk, the source code will reject it, requiring the use of the compress tool for distillation instead.
Context Window Can Be Automatically Detected¶
When modelContextLimit is omitted, it will use agent.ctx.llm.resolveModelInfo to detect the real window of the model, and fall back to 128000 if it fails. If this value is explicitly set, the detection will be skipped. The INSTALL document reminds: setting a too-small denominator (for example, writing 128K for a million-token window model) will make the usage rate artificially high and cause too frequent nudges.
Installation and Activation¶
The installation command given on the community catalog page is:
dsh plugin add github:Tyan66666/billion-context-dsh
For reproducible installations, the catalog page recommends pinning the commit:
dsh plugin add github:Tyan66666/billion-context-dsh#<commit>
The full form of the official DSH CLI is dsh plugin --profile <profile> add <source>. Starting from v0.2.0, the repository has declared the dsh.bundle manifest, and the one-click installation recommended by the README is to install from npm into the web profile (the release includes pre-built dist):
dsh plugin --profile web add billion-context-dsh
After installation, you need to restart dsh, as the bundle layer is only combined during startup. This is worth emphasizing separately: the .gitignore of the GitHub repository ignores dist/, and package.json does not have a prepare build script; the official documentation also states that installing from git gets the source code rather than the built product. The github: command on the catalog page can still be used as-is, but if loading fails, please prioritize using the npm package name above, or first run npm run build locally and then install via the tarball / symlink method described in docs/INSTALL.md.
The plugin runs with the permissions of the current dsh process, and may execute code during installation. Please review the source code and license terms before installing.
Attach the Compression Backend¶
Each agent can only have one context manager. Having two backends providing ctx.compaction in the same realm will cause conflicts, so you need to first disable the host’s compaction-basic and then insert this engine. The repository recommends attaching it globally to the host plane, which takes effect for standard / code / minimal / cordis / custom presets. Edit the profile patch, for example, ~/.dsh/profiles/web/cordis.patch.yml:
- id: compaction-basic
disabled: true
- insert:
- id: compaction-acp
name: 'billion-context-dsh'
config:
modelContextLimit: 128000 # Optional; omit to auto-detect, fall back to 128000 on failure
The cordis.patch.yml included in the bundle only inserts the default line without config. If you need to modify the window or prompts, manually add the configuration block as shown above. If you only want to replace the default backend in the compaction realm of a single agent preset, the same rule applies: first set disabled: true, then insert compaction-acp.
The INSTALL document also includes a detail: the shipped presets (standard / code / cordis) may still carry the realm-level dsh-compaction-basic as a fallback. ACP’s tools and nudges will be available, but the system will still automatically summarize when the pressure is too high. If you want a mode where the model fully controls the compression timing, the documentation suggests duplicating that preset and setting auto to false for compaction-basic in the copy. The shipped installation itself cannot be modified directly.
The optional config.prompts can override the opening sentence of nudges, range tables, system prompt segments, and the four tool descriptions. The template uses named placeholders (such as {pct}). Spelling errors will throw an error when the engine starts, rather than leaking the literal {pct} into the model context. If not configured, the acp-kernel’s rendering will be used directly.
Typical Usage¶
The following steps come from the verification checklist and tool conventions in the repository’s docs/INSTALL.md and can be reproduced as written.
1. Confirm the Tools Are Attached¶
Start a new conversation and ask the model to list available tools, or check the tool directory. The compress, decompress, search_context, and acp_status tools should appear. You can also directly ask the model to call acp_status, which will return the number of chunks, compressed tokens, estimated usage, and window source.
Equivalent command bar syntax:
/acp status
2. Compress a Segment in a Long Conversation¶
As the context grows, the model will call compress using the range table in the nudge. The parameter shape is one or more surface seq segments, plus a summary written by the model (the source code requires the summary to be at least 50 characters):
compress({ content: [{ startSeq, endSeq, summary }] })
On success, the documentation expects a return similar to Compressed N block(s), the visible context in the conversation will become shorter, and the blocks count in acp_status will increase. You can also compress a T1 range in the command bar (do not let the summary touch the checkpoint node of an existing compressed chunk):
/acp compress <startSeq> <endSeq> <summary...>
3. Restore and Retrieve¶
Compression is not deletion. When you need the original text:
decompress({ blockId })
/acp decompress <blockId>
To search within a chunk:
search_context({ query })
After restarting the same conversation, run acp_status again, and the chunk ledger should be rebuilt from the compaction/summary events in the log.
4. Hand the Installation Guide to the Current Conversation¶
The README also mentions another usage: this repository itself runs on DSH. You can feed docs/INSTALL.md to the agent in the conversation, ask it to read the guide, check the profile, modify the combined configuration, and verify the attachment. This requires the configuration to be under ~/.dsh, and you need to approve the file permission once; after installation, ask it to call acp_status to confirm successful attachment.
Applicable Scenarios and Notes¶
It is suitable for users who are already using DSH and often have conversations spanning multiple rounds of tool calls: coding agents, long tasks that need to repeatedly refer to early error messages and file paths. It solves problems such as “early details being silently discarded or rewritten by another summarizer when the window is full”, rather than literally expanding the context window to infinity. The “billion” in the plugin name comes from the naming of the upstream ACP solution, and this repository does not provide its own stress test figures for DSH.
Please note the following before use:
1. Beta Version. The README requires not to use this plugin and DSH in production; breaking changes are expected.
2. Do Not Attach Two Compression Backends in the Same Realm. The conflict target is ctx.compaction. For the global solution, disable the host’s compaction-basic; for the single-mode solution, first handle the dsh-compaction-basic in that realm.
3. Shipped Presets May Still Have Automatic Summary Fallback. When only attaching to the host plane, the realm-level basic compaction in standard / code / cordis may still automatically summarize under high pressure, which is not fully consistent with “pure model-driven compression”.
4. Do Not Misconfigure the Window Denominator. If modelContextLimit is set too small, nudges will appear too frequently.
5. Permissions and Source. The plugin runs with the permissions of the current dsh process. Check the GitHub source code and MIT license before installing; for a reproducible environment, pin the commit or use the published npm version.
6. Abbreviation Conflict. The ACP in this article refers to Active Context Pruning. DSH has another plugin related to Agent Client Protocol, which is not the same thing.
7. Not Fully Equivalent to the Pi Version. The upstream billion-context-pi also includes delegation tools such as acp_delegate; the DSH port exposes only the four compression tools and /acp, so do not look for delegation interfaces according to the Pi documentation.
Summary¶
billion-context-dsh transforms DSH’s context compression from “system automatically summarizes when the threshold is reached” to “the model decides what to compress itself”. The compression result is a checkpoint, and the original text remains in the append-only log, which can be restored and searched, and the ledger can be rebuilt from the log after restarting. It is a community-maintained MIT plugin, not an official DeepSeek store application; like the host, it is still in the testing phase. It is recommended to verify it in your own profile first, rather than deploying it directly to production conversations.
Community Catalog Page: https://deepseek-harness-plugin.com/en-US/plugins/billion-context-dsh/
GitHub Repository: https://github.com/Tyan66666/billion-context-dsh