kolawong/fast-compaction-dsh ↗★ 2

fast-compaction-dsh

Verdict-based compaction engine for DeepSeek Harness: replaces the lossy compaction summary with fast per-call keep/truncate/drop decisions, keeping everything else verbatim (port of tamaratran/fast-jev-compaction) 适合需要快速判定保留或丢弃上下文以优化模型调用的任务。

패키지
fast-compaction-dsh
호환성
미검증
버전
0.1.0
라이선스
NOASSERTION
최근 업데이트
2026. 9. 20.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:kolawong/fast-compaction-dsh

Configuration

All fields are optional and stack in two layers:

  1. The settings.yaml user layer (the fast-compaction: section of ~/.dsh/settings.yaml) — wins per field and applies live to subsequent compactions: the engine watches the settings service's hot-publish and rebuilds the Jev transport in place when apiKey/model/baseUrl change, so no restart is needed. The friendly editor is this package's own Web settings card (web/, the fast-compaction-dsh/client entry) on the Plugins page (apiKey rides as a secret role field — only a set/unset flag ever crosses the wire).
  2. The preset patch config: (composition layer) — the per-preset base values; changes require a DSH restart.

Per-field precedence: settings.yaml user layer > preset config: > environment (apiKey only, via TYPESAFE_API_KEY) > code defaults. Unlisted fields pass through to compaction-basic (thresholdRatio, retainRatio, retainTokens, summarizationProvider, summarizationModel, maxTokens, compactionRetries, maxOverflowRetries, modelPolicies, auto).

Note: a settings section whose values fail the schema (e.g. a string in keepThreshold) disables the whole settings layer and falls back to the composition layer, with a warning in the log; the layer retries on the next process start.

FieldDefaultMeaning
apiKeyTYPESAFE_API_KEYTypeSafe API key
modeljev-latestJev model name
baseUrlhttps://api.typesafe.ai/v1/systemoneSystem One endpoint
keepThreshold0.5Minimum keep probability for a call or result to stay
preserveRecentMessages6Newest messages never touched (the first is always kept)
maxStateTokens25000Estimated token ceiling for the state
maxRequestTokens30000Estimated ceiling for state plus one batch of questions
truncateHeadChars300Characters of a dropped tool result retained before its note
minReduction0.25Fall back to the built-in summary below this reduction ratio
disabledfalseUse only the built-in summarizer