
mengwEX/dsh-block-ptc
dsh-block-ptc
Model-controlled context blocks for DeepSeek Harness PTC mode
Install
npx @deepseek-ai/dsh plugin --profile web add github:mengwEX/dsh-block-ptcRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-block-ptc)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from mengwEX/dsh-block-ptc, cleaned of badges and images.
dsh-block-ptc
English | 中文
Blackboard blocks for PTC mode in DeepSeek Harness.
Version 0.4.0 uses block_compact({ ids, content }). The old block_summary
tool and summary/single id arguments are not supported. Restart DSH and
start a new Block PTC session after updating.
The block protocol uses the built-in run_code transport.
DSH's PTC presentation allows only run_code to be called directly, so the
model declares blocks in the tool description:
run_code({ description: "[block: <ids>] <goal>", code })
A block is a blackboard region. Every program the model runs is tagged with block ids. When the content is no longer needed, or its results have already been reported and the model is moving to other work, it can submit retained content it writes itself to replace the block's messages. Information still needed for execution, replies or discussion remains available. The original messages stay in the append-only session log, so the human transcript keeps everything and replay stays deterministic.
- DeepSeek Harness 0.2.1-rc.2 or newer; no upper version bound
- Community plugin maintained by mengwEX
- Zero runtime dependencies — the only external import is
node:crypto - License: MIT
Table of contents
- Why
- Context and cache comparison
- How it works
- Install
- Quick start
- Reference
- Design notes
- Verification
- Troubleshooting
- Known limits
- Development
- License
Why
Automatic compaction condenses history when token pressure builds, and it decides what to condense by size. It has no idea that the last forty messages were one finished sub-task and the next ten are a new one.
This plugin lets the model draw that line itself: open a block, work inside it, and close it with a handover summary — so the context it keeps is the one it chose to keep. The model submits the summary inside its program call; the plugin does not run a separate summarizer model.
Context and cache comparison
Mechanism illustration, not an API benchmark. Both panels replay the same synthetic four-task workload with assigned token weights. Full bar = input context; blue = modeled cache hits, orange = modeled cache misses. Cached tokens still occupy the context window.
After a block closes, the next request carries a summary in place of its completed work. Replacing history can also invalidate the cached suffix: smaller context does not guarantee a higher cache-hit rate or a lower bill. The closing assistant/tool pair settles before replacement; original user messages remain. The baseline has not reached its automatic compaction threshold.
See the data, assumptions and reproduction steps.
The plugin's tokensFreed is not a provider cache-hit measurement.
How it works
The model's whole surface is the built-in PTC transport plus one program-callable:
run_code({ description: "[block: <ids>] <goal>", code }) the only tool it may call directly
await tools.block_compact({ ids, content }) callable from inside a program
…
