DeepSeek Harness 插件

dsh-compaction-cacheaware

Reasonix-style cache-aware compaction backend for DeepSeek Harness (DSH). Replaces/enhances compaction-basic with compact_ratio, one structured summary checkpoint, and a stable recent tail.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
Zhuchen00123/dsh-compaction-cacheaware
最近更新
2026年8月18日
分类
记忆
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/Zhuchen00123/dsh-compaction-cacheaware
插件名:dsh-compaction-cacheaware
作者:Zhuchen00123

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-compaction-cacheaware

Reasonix-style cache-aware compaction backend for DeepSeek Harness (DSH).

This is a standalone, modular DSH plugin. It implements the official @deepseek-ai/dsh-compaction seam (ctx.compaction) and is designed to be mounted instead of @deepseek-ai/dsh-compaction-basic inside a preset's compaction realm. It does not modify other plugins, presets, or host files.

> 🐋 收录于 DSH 创意工坊 > > 本仓库打上 dsh-plugin topic 后,会被 > DSH 创意工坊 自动扫描收录。 > 在线地址:<https://JxaMe.github.io/dsh-workshop/>

Docs

  • [PROJECT.md](docs/PROJECT.md) — 项目说明与维护入口
  • [MAINTENANCE.md](docs/MAINTENANCE.md) — 维护手册
  • [MIGRATION_BRIEF.md](docs/MIGRATION_BRIEF.md) — 迁移交接说明
  • [reasonix_compact_design.md](docs/reasonix_compact_design.md) — Reasonix 原始设计

What it ports from Reasonix

  • One automatic trigger: compact_ratio (default 0.85), not multiple

soft/snip/force thresholds.

  • One structured checkpoint: stable prefix + one summary + recent tail.
  • Recent tail budget: clamp(window×10%, 32K, 96K).
  • Checkpoint acceptance: normal candidates ≤ 50% of window and below the

trigger; exceptional fixed-prefix path requires ≥25% savings.

  • Canonical transcript preserved: DSH's surface replace shadows the old

range in the model-visible projection only; the raw session log remains the source of truth.

  • One summarizer call per transaction: no application-layer retry loops.
  • Reasonix summary headings: Standing facts & constraints, Goal,

Decisions & rationale, Files & code, Commands & outcomes, Errors & fixes, Pending & next step.

Install / build

安装到 DSH profile(推荐)

已发布到 npm registry,直接安装:

cd "$env:USERPROFILE\.dsh\profiles\web"
pnpm add dsh-compaction-cacheaware

也可以从 GitHub 安装:

pnpm add dsh-compaction-cacheaware@github:Zhuchen00123/dsh-compaction-cacheaware

本地开发 / 构建

pnpm install
pnpm build

然后在 preset 的 compaction realm 里替换:

# - id: compaction-basic
#   name: '@deepseek-ai/dsh-compaction-basic'
- id: compaction-cacheaware
  name: 'dsh-compaction-cacheaware'
  config:
    compactRatio: 0.85
    checkpointCeilingRatio: 0.5
    recentTailRatio: 0.1
    recentTailMinTokens: 32768
    recentTailMaxTokens: 98304
    summaryMaxTokens: 16384

如果从源码本地调试,也可以直接用编译产物路径:

- id: compaction-cacheaware
  name: 'file:///absolute/path/to/dsh-compaction-cacheaware/lib/index.js'
  config:
    compactRatio: 0.85
    checkpointCeilingRatio: 0.5
    recentTailRatio: 0.1
    recentTailMinTokens: 32768
    recentTailMaxTokens: 98304
    summaryMaxTokens: 16384

Keep @deepseek-ai/dsh-command-compact in the same realm so /compact uses this backend. The optional @deepseek-ai/dsh-compaction-tool-result-pruner can still be mounted as a sibling; this plugin reads it through ctx.get().

Configuration

KeyDefaultMeaning
compactRatio0.85Sole automatic trigger fraction.
checkpointCeilingRatio0.5Normal auto-checkpoint acceptance ceiling.
recentTailRatio0.1Recent verbatim tail fraction.
recentTailMinTokens32768Lower bound for production tail.
recentTailMaxTokens98304Upper bound for production tail.
summaryMaxTokens16384Summarizer output cap.
exceptionalMinSavingsRatio0.25Required savings when fixed prefix exceeds ceiling.
minRecentKeep2Minimum recent messages kept.
minCompactMessages2Minimum compactable messages.
maxPinnedFirstUserTokens1500Pin first user turn if ≤ this.
pinnedFirstUserWindowFrac0.15First-user pin window fraction cap.
protocolReserveTokens256Framing reserve.
summarizationProvider / summarizationModel''Optional summary route; defaults to conversation route.
autotrueRegister automatic pressure/overflow listeners.

Modularity

  • The plugin only registers ctx.compaction and its own automatic listeners.
  • It does not edit dsh-wsl-bash, dsh-team-dashboard, router-opencode-wsl,

or any other plugin.

  • To use it, mount it in your own preset or profile patch; see

cordis.patch.example.yml in this package.

Keeping in sync with Reasonix

scripts/sync-reasonix-compact.mjs and the GitHub Action in .github/workflows/sync-reasonix-compact.yml watch esengine/DeepSeek-Reasonix and open/update a PR when the upstream compact implementation changes. The sync job:

1. Fetches the latest main-v2 Reasonix source. 2. Updates vendor/reasonix/compact/ with the upstream compact files and design docs. 3. Regenerates src/generated/reasonix-constants.ts from the Go constants and summary prompt (when they change). 4. Commits and opens a PR with a summary of what changed.

The generated constants are imported by this package so tuning values stay traceable to upstream.

Publish to GitHub / DSH Workshop

This repository is designed to be published as a standalone public GitHub repo. The DSH creative workshop discovers public repos with the dsh-plugin topic.

# 1. Authenticate GitHub CLI once
gh auth login

# 2. From this repository root, publish and add workshop topics
./scripts/publish.sh dsh-compaction-cacheaware

scripts/publish.sh will:

1. Create a public GitHub repo and push this repository. 2. Add dsh-plugin, deepseek-harness, and reasonix topics.

After that, the workshop index at <https://JxaMe.github.io/dsh-workshop/> will pick it up automatically (it scans dsh-plugin topic repositories).

License

MIT