Introduction¶
When running long sessions with DeepSeek Harness (DSH), the context window continuously expands: reasoning models generate a large volume of reflection markers such as Wait and Hmm during the generation phase. Once this content is written into the session, it is included verbatim in every subsequent request. If small-block compression is applied to the already-sent history at the egress (e.g., the automatic compression in the official compaction-basic), it often interrupts prefix caching. Consequently, the entire segment from the breakpoint onwards is recalculated at a cache-miss rate. The author refers to this cost as the “breakpoint tax” in the README.
The following is an introduction to the community plugin dsh-entry-shaper (maintainer MaudieHakimi, GitHub repository MaudieHakimi/dsh-entry-shaper, categorized as “Model Reasoning” on SkillHub). Its approach moves shaping to the ingress: it fixes the shape of session elements by running an op chain based on their category before they are sent over the network for the first time. Thereafter, it does not rewrite the already-sent form, thereby striving to keep the outbound payload prefix monotonic. The current version of the plugin is 1.0.6, with a status of experimental and disabled by default. It requires Node ≥ 20, is licensed under MIT, and has a test score of 94/94.
What is this¶
dsh-entry-shaper is a payload shaping plugin for DSH: it configures op chains by category (reasoning, toolResult, toolArgs, assistantText, etc.) and transforms unsent content at the wire layer of the proxy channel. It does not interfere with the model’s reasoning process during generation; it only alters the form of “what the model sees as its own past thoughts” when that content enters the context and is sent out again.
The README emphasizes: it is not a panacea for eliminating all breakpoints—official auto-compaction, cache TTL, switching providers, or config changes can still interrupt the prefix. What it guarantees is that it itself will not perform stateful rewrites on already-sent content. The default strategy primarily shapes the reasoning category, while most other categories are set to keep. The upper bound of savings depends on the proportion of reasoning in the payload (README benchmarks show approximately −21% ~ −47%).
Core Mechanism & Capabilities¶
Ingress Shaping vs. Egress Compression¶
After generation ends, built-in strategies (like extract) can compress long reasoning chains into shorter decision sentences before sending them out. Subsequent requests in the context carry the shaped text rather than the full filler chain. This aligns with the design goal of “retaining the benefits of reflection markers during generation while removing their burden from the context”—see the repository README and docs/ for literature and boundary explanations.
Pluggable Op Chains¶
The plugin provides pure ops (keep, drop, extract, head, tail, truncate, etc.) and three external integration methods, which can be mixed on the same chain:
| Transport | Meaning |
|---|---|
inline |
In-process algorithm, hot-reloadable config |
exec |
Subprocess (python / node / arbitrary command) |
http |
LLM summarization via OpenAI-compatible endpoints |
External calls use a unified I/O: the input envelope contains text, kind, meta, op, protocol: 1; the return is { "text": "…" }, { "text": null } (delete entire block), or raw text. If a single op fails or times out, it fails open (skips that step without blocking the session). Non-pure ops rely on content hash caching to maintain determinism; the README states that the cache hit rate for long sessions is approximately 98.4% ~ 99.6%.
Proxy & Config Hot-Reading¶
Configuration is placed in ~/.dsh-entry-shaper.config.json (do not write it into cordis.patch.yml, otherwise market hot-mounting may be restricted). Enabling proxy.enabled: true lazily registers a route (default provider name deepseek-shaped); simply point the session or default provider to this name. Configuration changes are hot-read based on mtime, generally requiring no restart; creating an empty file ~/.dsh-entry-shaper.OFF will immediately enable pass-through forwarding.
Installation & Activation¶
The plugin runs with DSH’s current process permissions. Please review the source code and LICENSE yourself before installing; do not guess installation commands based on the name. The method provided in the README is local directory installation (replace the path with your local location):
dsh plugin --profile web add "file:D:\plugins\dsh-entry-shaper"
Manual installation is also possible: copy the directory to the profile’s node_modules, and add it to both dependencies and dsh.profile.bundles in the profile’s package.json, ensuring dsh.bundle.patch still points to this package’s cordis.patch.yml.
Alternative mounting methods include: the SkillHub market page hot-switch (no restart needed if the patch is a pure insert), or using ctx.plugin(module) in the cordis context for experimentation. Note that dsh plugin … add "file:…" installs a physical copy rather than a symlink; modifying the source directory alone will not take effect—you must copy it into node_modules or re-add it.
Typical Configuration¶
First, create or edit ~/.dsh-entry-shaper.config.json in the user directory. The README example (master switch, per-category op chains, cache, and proxy) is as follows:
{
"enabled": true,
"shapeReasoning": true,
"policy": {
"reasoning": { "ops": [{ "op": "extract", "maxChars": 240 }] },
"toolResult": { "ops": [{ "op": "keep" }] },
"toolArgs": { "ops": [{ "op": "keep" }] },
"assistantText": { "ops": [{ "op": "keep" }] }
},
"cache": { "enabled": true, "path": "~/.dsh-entry-shaper.cache.jsonl", "maxBytes": 8388608 },
"proxy": { "enabled": true, "provider": "deepseek-shaped", "upstream": "deepseek-official" },
"opTimeoutMs": 8000,
"logPath": "~/.dsh-entry-shaper.log"
}
The README specifically warns: paths in the config do not expand ~; a typo will create a folder named ~ in the current directory. It is recommended to omit path keys to use default absolute paths, or write the full absolute path.
Common reasoning strategy snippets (from the README “copy-and-use” section):
// Default approach: reasoning keeps only decision sentences
"reasoning": { "ops": [{ "op": "extract", "maxChars": 240 }] }
// Conservative: keep the real beginning
"reasoning": { "ops": [{ "op": "head", "chars": 800 }] }
// Custom in-process filter (example)
"reasoning": { "ops": [{ "op": "inline", "use": "code",
"code": "return text.split('\\n').filter(l => !/^(Let me|I will)\\b/.test(l)).join('\\n')" }] }
The marker for extract defaults to false; if set to true, it adds a [reasoning extract: …] prefix. The documentation notes that this marker pollutes the model’s context (see docs/POLLUTION.md).
Use Cases & Caveats¶
Who it is for: Long sessions with a high proportion of reasoning content, where you want to reduce outbound tokens without frequently modifying already-sent history; or those willing to integrate custom shaping algorithms via exec / http / inline to reuse the plugin’s caching, timeouts, and fail-open mechanisms.
Limitations you must be aware of (all from the README, not marketing promises):
- “Cleaner” ≠ Proven “Smarter”: The plugin has not undergone behavioral control experiments after removing filler words; it only guarantees the separation of outbound form from the generation process.
- Known bias in built-in
extract: The decision sentence rules retain a large amount ofLet me/I willtype long fillers. The README states that approximately 76.9% of retained sentences are still self-narrative markers; seedocs/FILLER-WORDS.md§5 for details (candidate fixes not yet implemented). - Session log pollution: Benchmarks show that shaped reasoning blocks may appear in logs, and the original text is not guaranteed to be preserved; a side path using
node tools/original.mjsis available to trace the original text of the current turn (seedocs/POLLUTION.md). - Changing config changes prefix form: The next request may be recalculated at full price (README estimates around $0.2), so it is advisable to finalize the strategy in one go.
- Division of labor with the official stack: The official version already has tool-result-pruner, compaction, etc.; it is recommended to read
docs/OFFICIAL-STACK.mdbefore enabling this plugin to avoid duplicate pruning or expectation conflicts.
The DSH ecosystem is “everything is a plugin”; the SkillHub directory page is a community site and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-entry-shaper moves context compression from the egress to the ingress: it performs deterministic shaping on session elements at the wire layer before they are sent out for the first time, focusing on reasoning blocks by default, and provides a unified protocol for custom algorithms. If you are running R1-class reasoning models on Harness and care about payload and prefix stability, you can install it according to the README after reviewing the source code, starting with small steps like enabled and policy.reasoning.
- Directory Page: https://www.skillhub.cn/plugins/MaudieHakimi/dsh-entry-shaper
- Source & Docs: https://github.com/MaudieHakimi/dsh-entry-shaper