lifeodyssey/dsh-compressor

DeepSeek Harness plugin: compress tool output, cut up to 20% of context, without touching the context cache or agent performance.

项目介绍Project Overview

dsh-compressor 是 Headroom 的精简移植插件,用于在工具执行后压缩冗长日志、JSON、diff 等输出,最多可减少约 20% 上下文。它会保留磁盘原文、不改动已发送前缀以维持缓存有效,并提供工具让代理取回完整内容。适合工具输出过长、需要节省上下文时使用。目前代码感知与 ONNX 长文压缩尚未接入。

dsh-compressor is a slim port of Headroom for DSH. It compresses long tool output such as logs, JSON, text, search results, and diffs, cutting up to about 20% of context while preserving the original on disk and leaving the already-sent prefix untouched so context caching remains valid. It also gives the agent a tool to retrieve full content. Use it when tool outputs consume too much context. Code-aware and ONNX-based long-prose crushers are not yet wired in.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add dsh-compressor

lifeodyssey/dsh-compressor 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

English | 中文

dsh-compressor

npm CI

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.

上一个 Prev dsh-computer-use 下一个 Next dsh-web-search-free