Community plugin

casualjim / dsh-headroom

Headroom context compression for DeepSeek Harness: tool-result compression, CCR retrieval, stats — over the configured Headroom proxy URL, with graceful degrade

  • TypeScript
  • MIT
  • 1 stars
  • Sep 20, 2026

About this plugin

Written by the registry from verified metadata, not from the README.

dsh-headroom is a DSH plugin published from the dsh-headroom package in the casualjim/dsh-plugins repository.

  • Listing statusManifest verified
  • Manifest checkedNov 16, 2026
  • Packagedsh-headroom
  • Package pathdsh-headroom
  • Repository createdAug 23, 2026

Capabilities and topics

dsh-pluginsdsh-skilldsh-web
From the repository README

README

Everything below this line is the repository's own document, cached here. This site did not write or review it.

dsh-headroom

DeepSeek Harness port of the noheadroom Pi extension: Headroom context compression as a DSH Cordis bundle.

What it does

  • Tool-result compression — before each model step, the current session surface is sent to a Headroom proxy (/v1/compress via the headroom-ai SDK client) and oversized tool results are replaced with their compressed forms. Only tool/result content mutates; user prompts, assistant text, tool-call metadata and tool ids are preserved, exactly like noheadroom's Pi policy.
  • CCR retrieval — headroom_retrieve model tool fetches full originals for hashes in compression markers.
  • Stats & control — /headroom status|on|off|health|stats|mode <normal|quiet|silent>|run.
  • Graceful degrade — the proxy is a configured URL, never spawned or managed by this bundle. Unset or unreachable → compression is a no-op with a one-time warning; everything else keeps working.

Install

dsh plugin --profile web add <path-to-this-package>

Run a Headroom proxy yourself (or point at an existing one):

headroom proxy --port 8787

Configuration

Cordis row config (see cordis.patch.yml), environment second, defaults last.

keyenvdefaultmeaning
baseUrlDSH_HEADROOM_URL → HEADROOM_URL → HEADROOM_BASE_URLnullproxy URL; null degrades
enabledDSH_HEADROOM_ENABLEDtruecompression on at boot
modeDSH_HEADROOM_MODEnormalnormal/quiet/silent output
minContextTokensDSH_HEADROOM_MIN_CONTEXT_TOKENS20000skip passes below this surface token estimate
minMessageCharsDSH_HEADROOM_MIN_MESSAGE_CHARS2000per-tool-result candidate floor
timeoutMsDSH_HEADROOM_TIMEOUT_MS30000per proxy call
throttleMsDSH_HEADROOM_THROTTLE_MS3000minimum gap between passes
allowRemoteDSH_HEADROOM_ALLOW_REMOTEfalserefuse non-localhost URLs unless true
renameToolCallsDSH_HEADROOM_RENAME_TOOL_CALLStruedefeat Headroom's protected-tool exclusions (read, bash, …)
maxSeenFingerprintsDSH_HEADROOM_MAX_SEEN_FINGERPRINTS512seen-content FIFO cap

How it integrates (no proxy reliance, no interception)

DSH has no pre-LLM-call message interception seam; instead this bundle rewrites the durable session surface, the same pattern as the built-in @deepseek-ai/dsh-compaction-tool-result-pruner:

  1. agent/pre-step fires → gates check (enabled, throttle, surface tokens ≥ minContextTokens).
  2. Surface snapshot → converted to OpenAI wire messages (tool results as candidates, user/assistant as context; tool-call names renamed to pi_tool_result so Headroom's DEFAULT_EXCLUDE_TOOLS doesn't skip large reads).
  3. POST /v1/compress → result validated per message (count, roles, tool_call ids unchanged).
  4. Each applied tool result lands as a replacement tool/result node (surfaceOp: replace) preceded by the shared compaction/prune shadow-price event, so token accounting subtracts the shadowed node's price.
  5. Loop prevention (ported from noheadroom): reentrancy flag, 3s throttle, input/output/candidate fingerprint trio, seen-content FIFO (original + applied hashes), guard-skip recording.

What Headroom offers that this bundle does NOT cover

Headroom's full surface was investigated against the upstream repo (v0.36.4):

  • Memory (--memory, cross-agent store) — proxy-side feature that only operates when chat requests pass THROUGH the proxy in passthrough mode. DSH sends chat directly to its provider and only calls /v1/compress, so the proxy's memory injection is unreachable. There is no memory HTTP endpoint.
  • Codebase indexing (--code-graph) — not Headroom at all: it downloads and runs the third-party codebase-memory-mcp binary and watches files for it. No HTTP endpoint; not usable from a compression client.
  • headroom learn — Python CLI that mines agent session logs and shells out to the claude CLI. Not exposed over HTTP.
  • Output token reduction — implemented inside the proxy's passthrough path only.
  • Kompress-v2 ML model — runs in the proxy's Rust core; we get it for free by talking to the proxy.

All of the above are proxy-side capabilities; this bundle consumes only the client-facing surface: /v1/compress, /v1/retrieve, /stats, /health.

Port notes

  • bridge.ts is a faithful port of noheadroom's bridge.ts (payload build, apply-back, alignment validation, marker naturalization, cheap token estimate) re-typed against @deepseek-ai/dsh-llm messages.
  • client.ts + proxy-manager.ts from noheadroom are replaced by transport.ts: same HTTP endpoints via the official headroom-ai SDK client. No proxy process management exists.
  • noheadroom's settings.json persistence is replaced by the cordis row config + env; /headroom on|off|mode mutate live state only.
  • Markers are naturalized to name the headroom_retrieve tool (noheadroom named Pi's read tool; DSH has no fixed read tool).
  • Token numbers in stats/footer text are the cheap ceil(len/4) estimate, not provider metering.

Badge

Listed here? Link back with this badge — paste the snippet into your repository README.

Listed on DSH Plugin badge
[![Listed on DSH Plugin](https://dsh-plugin.com/badges/listed.svg)](https://dsh-plugin.com/plugins/casualjim/dsh-plugins/dsh-headroom)