dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Manual budget-targeted context compression for DeepSeek Harness: the conversation model picks ranges, a cheap flash-tier route writes the summaries.
Every turn of an expensive-model session re-sends its whole history. /squeeze shrinks it to a budget you pick.
A slash command for DeepSeek Harness that compresses a session's context on demand — with the summaries written by a cheap flash-tier route instead of the model you're paying for.
/squeeze status
Surface: 331 messages, ~371,000 tokens — OVER budget by 271,000 (budget 100000).
Summarizer: ollama/deepseek-v4.1-flash:cloud. Read-only; nothing was changed.
/squeeze
Squeeze mode activated (target 100000 tokens, ~371,000 now; summaries via
ollama/deepseek-v4.1-flash:cloud). The model will pick ranges; the summarizer
writes the checkpoints.
... the model reviews its context, marks compressible ranges,
flash summarizers write the checkpoints in parallel ...
Squeezed 3 span(s) (~74,963 tokens shadowed). Surface now 116 messages, ~97,445 tokens.
/squeeze status
Surface: 44 messages, ~45,780 tokens — under budget (100000 by 54,220).
/squeeze map lets you browse them.Span end-state: line (COMPLETED/PENDING per task), and the squeeze result carries a trusted open-work digest computed from the uncompressed tail — so the model doesn't re-enter work a summary describes without its completion status./squeeze compress toward contextBudgetTokens (preset config)
/squeeze 60k one-off token target (also plain: /squeeze 60000)
/squeeze status read-only: message count, token estimate, budget, summarizer
/squeeze map read-only: interactive HTML map of every checkpoint
/squeeze help full usage guide
/squeeze map — see what compression did/squeeze map replays the session log into a self-contained HTML page (written to your temp dir and opened in your browser; no LLM calls, nothing modified). On a squeezed session it shows:
/squeeze invocation (reconstructed from commit timestamps) — every checkpoint bar is clickable.original, after squeeze N (one per invocation), and current: exactly what the model's working set looked like at each point in time.It also works on never-squeezed sessions (all-live histogram, full transcript — a useful preview of what a squeeze would chew on).
(Synthetic demo data — regenerate with node tools/squeeze-explorer.mjs --demo.)
The same view is available as a standalone script for any session log, without mounting the plugin:
node tools/squeeze-explorer.mjs ~/.dsh/sessions/<workspace>/session-<id>/session.jsonl.zstd
git clone https://github.com/hardes11/dsh-squeeze-command.git ~/.dsh/commands/dsh-squeeze-command
node_modules, so the manifest entry plus the
symlink puts it there:// e.g. ~/.dsh/profiles/web/package.json — substitute your profile
"dependencies": {
"dsh-squeeze-command": "link:../../commands/dsh-squeeze-command"
}
ln -s ../../../commands/dsh-squeeze-command ~/.dsh/profiles/web/node_modules/dsh-squeeze-command
~/.dsh/presets/<name>/agent.cordis.yml):- id: command-squeeze
name: 'dsh-squeeze-command'
config:
contextBudgetTokens: 100000
summarizerProvider: <your-provider>
summarizerModel: <your-flash-model>
/squeeze status. If it prints a budget line, the
command is live. (Status works even unconfigured — it tells you what is missing.)| Field | Default | Meaning |
|---|---|---|
contextBudgetTokens | — (required for bare /squeeze) | target for bare invocation |
summarizerProvider | — (required) | provider key for the summary route |
summarizerModel | — (required) | model id for the summary route |
summarizerReasoningEffort | null | effort pin for summarizer calls; pin e.g. low only if the route's effort map declares it |
summarizerConcurrency | 5 | max parallel summarizer calls |
maxSpanInputTokens | 30000 | per-span summarizer input cap |
maxSummaryTokens | 2048 | per-summary output cap |
minSpanTokens | 200 | span floor worth a checkpoint |
maxSnapSteps | 5 | balanced-edge snap budget |
Invalid values (zero, negative, non-integer) fail at plugin load with a named-field error, not at squeeze time.
The summarizer route should be a cheap, fast model — a flash-tier model is the sweet spot: dense summarization is not reasoning-heavy work, and spans run in parallel. The plugin is provider-neutral; any route registered in your DSH settings works.
@deepseek-ai/dsh-compaction and @deepseek-ai/dsh-llm. Works across API generations: 0.1.1's eager session.events array and 0.1.2's snapshotEvents() are both handled, and the surface replacement emits whichever SurfaceOp field names the host validates (start/end before 0.1.5, startSeq/endSeq from 0.1.5). The shape is detected once per process, safely: an append rejected for its field names validates before it touches the session log, so the retry commits at the same position.cordis.patch.yml (insert-only, own row) + a dsh manifest block with compatibility.dshReleases (0.1.1, 0.1.2-rc.1, and 0.1.5-rc.2 declared — each verified by live runs).engines).Caveats worth knowing before installing:
Long conversations with expensive models drown in input-token costs: every turn resends the whole history, and input cost dominates — not the thinking. A 300k-token conversation sent to a frontier model on every turn is the budget killer; the cached-prefix discounts providers offer (prompt caching) only soften it while the prefix stays stable.
/squeeze shrinks the context toward a budget you choose, with one deliberate division of labor: the conversation model (expensive or not) only picks which spans to compress — a small, cheap decision — while a configured summarizer route writes the checkpoint summaries, so compression never costs frontier prices.
/squeeze asks the model to mark compressible ranges (one tool call). A cheap route writes the summaries in parallel. Checkpoints commit sequentially, and the originals stay in the session log. After a successful squeeze, one extra cheap-route call digests the uncompressed tail into an open-work restatement appended to the tool result — historical summaries never outrank it.
summarizerConcurrency) holding no lock; each checkpoint then commits through its own tight synchronous bracket (compaction/start → compaction/summary → surface replace → compaction/end), honoring the compaction capability's single-lock contract. No code path can leave a bracket dangling.npm ci # .npmrc pins legacy-peer-deps for the rc-tagged peer closure
node smoke.mjs # 59 behavior checks against real Session objects, no LLM needed
The harness resolves the message/tool-call helpers and the session log accessors per generation, so it runs unchanged against pre-rename and post-rename hosts (verified on the published rc.6 closure, the 0.1.2 fork line, and 0.1.5-rc.2).
/squeeze -h and --help work as aliases for help.