Snow-ea/dsh-token-optimizer
Deterministic, recoverable compression of large tool results plus cache-aware early compaction for DeepSeek Harness, with a spill archive a session can read back exactly.
Compresses large successful text tool results before they repeatedly enter the model context, and compresses PTC sub-dispatch log copies without changing the complete structured values that run_code programs receive. Every lossy replacement is archived and exposed through a retrieve_spill tool for exact, session-authorized recovery, and each replacement is mirrored into DSH's own spill backend when one is present. It registers a root-level BasicCompactionEngine with a 0.625 default threshold ahead of the isolated stock engines (which fall back at 80%), while preserving cache-aware replay, the branded Session API and routed image accounting. A Web conversation dashboard and a declared localized title, description and icon make it a first-class Plugin Manager bundle. Both the switch (compaction: false turns early compaction off while compression, retrieval and the dashboard stay active) and the ratios (thresholdRatio, retainRatio) are configurable.
Install
dsh plugin --profile web add dsh-token-optimizer@0.2.4Copied verbatim from the README's Install block, which pins the bundle version. package dsh-token-optimizer, registry latest 0.2.4, and its repository field resolves back to github.com/Snow-ea/dsh-token-optimizer. The README asks you to restart the existing dsh web process after installing.
Compatibility
Targets DSH 0.2.1-rc.2. The README notes that since 0.1.7-rc.1 the host checks a plugin's @deepseek-ai/dsh* peer ranges at startup and that 0.2.0-rc.2 made that check fail-closed, so a bundle whose ranges do not match the runtime is refused rather than disabled in place. It also documents an overlay needed for non-Web profiles while the compaction switch is on.
Details
- Repo: Snow-ea/dsh-token-optimizer
- Category: Sessions & Messages
- Stars: 3
- Version: 3 stars, TypeScript, MIT, created 2026-08-30; install source is npm (dsh-token-optimizer, latest 0.2.4, registry repository field resolves back to this repo); English README with a README.zh.md translation.
Alternatives
p2coder/dsh-task-control · ishuowang/dsh-agent-team-room · GooDAnDReaDY/dsh-session-control