lifeodyssey/dsh-compressor
DeepSeek Harness plugin: compress tool output, cut up to 20% of context, without touching the context cache or agent performance.
已收录
1
Tools
Bundle 已验证
预览
功能介绍
Headroom 的精简移植,在不影响模型上下文缓存以及 Agent 性能的情况下,压缩工具的输出,至多减少 20% 的上下文。
适合
- 工具调用较多、长日志、JSON、搜索结果、文本或 diff 大量占用上下文的 agent 会话。
- 希望缩短模型可见工具输出,同时把原始内容保存在磁盘上以便取回的工作流。
- 希望保持已发送上下文前缀不变以复用缓存的长会话。
不适合
- 工具输出本来就很短、压缩收益有限的会话。
- 需要基于 tree-sitter 的代码感知压缩或基于 ONNX 的长文本压缩的工作流;这些压缩器尚未接入。
- 要求每个工具结果的全部细节始终立即可见、不能通过取回工具补充上下文的场景。
README
| English | 中文 |
dsh-compressor
A slim port of Headroom. Compresses tool output and cuts up to 20% of context, without affecting the model’s context cache or agent performance.
Install
dsh plugin --profile web add dsh-compressor
How it works
A tool run leaves a long log / JSON / diff. Only a small part of it is useful. This plugin shortens that output before the next turn, keeps the original on disk, leaves the already-sent prefix alone so the cache stays valid, and gives the agent a tool to pull the full context back.
flowchart LR
A[Tool finishes] --> B{Output long?}
B -->|no| C[Full text stays]
B -->|yes| D[Shorten and save original]
D --> E[Model sees the useful part]
Compressor code comes from Headroom. Wired in today: Log / Smart / Text / Search / Diff. The only crushers not wired in yet:
- Code-aware (tree-sitter, source code)
- Kompress (ONNX, long prose)
Develop
cd plugins/dsh-compressor
pnpm install
pnpm test
Contributing
Open PRs on this repo, not on Headroom.
Plugin code is in plugins/dsh-compressor (Node 22+, pnpm):
cd plugins/dsh-compressor
pnpm install
pnpm test
pnpm typecheck
Crushers live in crates/:
cargo test --workspace
make test-parity
One change per PR. Plugin changes need tests; crusher changes need cargo test. Details: CONTRIBUTING.md.
This plugin is MIT. crates/headroom-* remains Apache-2.0.
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:lifeodyssey/dsh-compressor。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。