Preface¶
In agent environments like DeepSeek Harness (DSH) where “everything is a plugin,” session text, tool calls, and tool results quickly accumulate, filling up the context window. A common approach is to have the model perform another round of summarization; this introduces additional model calls, latency, rewriting risks, and the issue of difficult-to-precisely-recover details after compression.
dsh-compaction-instant offers an alternative: it uses deterministic text processing instead of LLM summarization to compress shadowed history spans and points omitted content to seq values in persistent logs. It serves as a drop-in replacement for @deepseek-ai/dsh-compaction-basic, preserving the same seam, events, provenance, and failure vocabulary.
What This Is¶
- Plugin Name:
dsh-compaction-instant - Maintainer:
TsFreddie - License: MIT
- Runtime Requirement: Node.js
>= 18 - Repository: https://github.com/TsFreddie/dsh-compaction-instant
One-line positioning: This is DeepSeek Harness’s instant, near-lossless context compression engine. Its core goal is not “to have the model summarize shorter” but to compress historical snippets into deterministic entries that are still recoverable.
Core Features¶
Instant Compression Without Model Involvement¶
The compression process does not invoke the model or make network requests. The documentation describes it as using deterministic text processing for instant compression of shadowed history spans.
This means the compression path does not rely on summarizer prompts, does not generate extra inference calls, and does not involve KV-cache-related processing.
Output Retains Original Tokens¶
The compressed output only retains original tokens and does not perform rewriting summaries. Omitted content leaves behind seq pointers for subsequent recovery.
This differs from the “compression means you can only regenerate” approach: the key here is that the compression result still points to original events in the persistent session log.
Aligned with @deepseek-ai/dsh-compaction-basic¶
The plugin is positioned as a drop-in replacement for @deepseek-ai/dsh-compaction-basic and preserves the same seam, events, provenance, and failure vocabulary.
For DSH scenarios using the existing basic compression backend, this means it is not another independent system requiring reconstruction of event streams and failure semantics.
Provides Recall and Search Recovery Capabilities¶
The plugin provides two types of model-side tools:
recall: Used to recover persistent log content omitted by compression.search: Used to search persistent logs by keyword or regex, including content omitted by compression.
Additionally, it provides a human-side command /recall, used to append a durable recall user message, allowing the next model turn to see matching events and seq pointers.
Typical Usage¶
Compressed Form¶
In documentation examples, a history snippet containing user request, assistant text, tool call, and result can be compressed into a single-line entry like:
[user]
please fix the bug
[assistant]
on it
* read "a.js" (seq 2 -> result 3)
[user]
next question
Here, (seq 2 -> result 3) is a persistent log pointer. The compressed content does not simply disappear; it remains accessible through the pointer.
Recovering Original Text with recall¶
The recall tool is used to restore original text to the current tool result. Documentation-provided recovery types include:
type: "seq"
type: "result"
type: "checkpoint"
seq: Used to recover corresponding content based onseqpointers.result: Used to recover tool results based onresultpointers.checkpoint: Used to recover corresponding content based on checkpoint identifiers.
Searching Persistent Logs with search¶
The search tool is used to perform keyword or regex searches on persistent logs. Search scope includes content already omitted by compression and returns matching events along with their seq pointers.
This tool is suitable when the model is unsure of the original text location: search first, then recover based on the returned seq pointers.
Human-Side Usage of /recall¶
The human side can use the following command:
/recall <keyword|regex>
This command appends a durable recall user message containing matching events and seq pointers for the next model turn to view.
Configuration and Compatibility Notes¶
The following configuration item names are preserved as-is and appear as optional configurations:
thresholdRatio
retainTurns
retainTokens
auto
checkpointCap
textTokens
userTextTokens
toolCallTokens
maxRecallTokens
maxSearchHits
These configuration items control compression budget, retention scope, automatic behavior, and read limits for recall/search.
Compatibility points to note:
- The budget is enforced both by token count and constrained by a
budget × 4character limit. maxTokensandcheckpointScaleare accepted but deprecated and do not participate in the budget.summarizationProviderandsummarizationModelare accepted for compatibility but have no effect.toolResultExcerptTokensis accepted for compatibility but has no effect.- Missing array configuration items are treated as unset and fall back to default values; empty arrays do not disable built-in items.
Applicable Scenarios and Considerations¶
Suitable for:
- DSH plugin developers who want to compress context without additional model calls.
- Sessions aiming to reduce network calls, model calls, and KV-cache-related overhead in the compression path.
- Scenarios where omitted content should still be recoverable via
seq,result, or checkpoint pointers. - Host environments already using
@deepseek-ai/dsh-compaction-basicwho wish to replace LLM summarization with deterministic compression.
Pre-use considerations:
- The plugin typically runs with the current
dshprocess permissions. Check source code, dependencies, and license before installation. - Current documentation does not provide official installation commands; this article does not fabricate
dsh plugin add ...forms based on names. - The DeepSeek Harness community directory is an independent site with no official affiliation to DeepSeek / High-Flyer and should not be described as an official app store.
Conclusion¶
The value of dsh-compaction-instant lies in changing context compression from “let the model summarize again” to “deterministic trimming + recoverable pointers.” Current documentation does not provide a community directory page address; the repository address is https://github.com/TsFreddie/dsh-compaction-instant.