falling-ts/dsh-force-compact
Aggressive, local-first context compaction for DeepSeek Harness: instead of fighting a small context cap it shrinks the conversation itself, so a self-hosted llama.cpp model reasons over a tight prompt while deep memory stays in the compressed head — no per-token billing and no data egress. Two engines coexist behind one resolveCompaction facade (the official compaction service, plus a self-contained builtin fallback), triggered per request, at idle, manually via /force-compact, or on session flush.
dsh-force-compact is an aggressive, local-first context-compaction plugin for DeepSeek Harness: instead of fighting a small context cap it shrinks the conversation itself, keeping the compressed head as deep memory while the agent reasons over a tight prompt. Two compaction engines coexist behind one resolveCompaction facade — the official compaction/basic service when it resolves in the agent realm (preferred), and a self-contained builtin fallback otherwise (a persistent transaction on ctx.sessions / ctx.llm.stream / ctx.tokenMeter that reuses the official compaction/* event vocabulary), so it replays safely across builds. Triggers include a per-request guard on agent/pre-step that reads the session's projected context tokens and, at autoThresholdTokens, rejects the outgoing request and compacts the head while retaining the latest retainLatestTokens verbatim; an optional turn-end/idle compaction; a manual /force-compact command (lazily loaded, carrying the same icon/name/description face as first-party commands); and a session/flush durability checkpoint. disableThinking: true (default) turns thinking off only for the plugin's own summarization call; every other model request is unchanged.
Install
dsh plugin --profile web add github:falling-ts/dsh-force-compactCopied verbatim from the README's install block (# from git:); the same block documents a local-checkout form dsh plugin --profile web add ./dsh-force-compact.
Compatibility
Designed for a self-hosted llama.cpp server (the README's example serves Qwen3.8-27B) reached through the standard DeepSeek adapter, so the agent reasons over a tight prompt with no per-token billing and no data egress.
Details
- Repo: falling-ts/dsh-force-compact
- Category: Memory
- Stars: 10
- Version: GitHub repo falling-ts/dsh-force-compact (10★) — a DSH Cordis function plugin, installed as a github: spec to the repo itself.
Alternatives
863683348/dsh-plugin-focus · akslcw/dsh-negative-ledger · askdkc/kiokuko-dsh