huohua-dev/dsh-compaction-policy
Applies a global compaction policy to eligible DSH Basic instances - proactive budget threshold with no double output reservation, atomic useful-range selection, and no-progress retry guards - without changing the default provider or preset.
Installs one root plugin, compaction-policy-global, which applies an experimental global compaction policy to eligible official Basic instances in the same Cordis runtime — without registering a preset, filtering the preset registry, or changing the default provider. It keeps Basic's summarizer, checkpoint records, tool pairing, token meter and native /compact, and changes three things: proactive budgeting (default thresholdRatio: 0.9, so the threshold is floor(W × 0.9), with outputReserveCap: 0 and headroomTokens: 0 avoiding a double deduction — 65,536 becoming 235,929 tokens on a 262,144-token window with a 131,072 output cap), range selection (a 0.16 soft recent-tail target, atomic messages and tool-call units, system-node barriers, at least 2,048 non-checkpoint tokens), and no-progress retries (60s, 120s, 240s backoff up to 600000 ms, one summary transaction per pressure step). /compaction-policy-global status|reset inspects coverage or clears the retry guard; dryRun observes without pruning, and modelPolicies overrides per exact provider/model.
Install
dsh plugin --profile web add github:huohua-dev/dsh-compaction-policy#v0.2.2Copied verbatim from the README's "Non-Electron-managed web profile only" sh block, which it explicitly limits to a web profile not managed by Electron/Desktop; the README says Desktop-managed profiles must be installed through the Desktop plugin-manager UI instead. no package published — the README states "Distribution is via GitHub, not npm" and pins the v0.2.2 release tag.
Compatibility
The bundle load-admits the DSH ^0.2.1-rc.1 host line (0.2.x, including later release candidates) plus Cordis 4.0.x, but the policy activates only when five Basic method fingerprints match the verified implementation — otherwise it stays loaded and inert on stock Basic. Desktop-managed profiles must be installed through the Desktop plugin-manager UI, then the app fully quit and restarted; the README says a page refresh or profile reload is not a substitute, and that CLI changes to a Desktop-managed profile are rejected. A profile reload is required after editing the compaction-policy-global config, and headless use of that entry needs the host's commands and agentPresets services.
Details
- Repo: huohua-dev/dsh-compaction-policy
- Category: Sessions & Messages
- Stars: 0
- Version: 0 stars, JavaScript, MIT, created 2026-10-03; install source is the pinned GitHub tag github:huohua-dev/dsh-compaction-policy#v0.2.2 because the README says distribution is via GitHub and not npm (the npm registry lookup (2026-10-17) returned no package); English README with a README.zh-CN translation.
- First seen: 2026-10-03
Alternatives
hy-sde/dsh-session-url · knighthongyu/dsh-handoff-compaction · beijingwahw/dsh-companion