dsh-context-manager: Reviewable Conversation Context Compression

Introduction

When running long sessions in DeepSeek Harness (DSH), the context stacks up continuously: system instructions, user messages, assistant replies, tool outputs, attachment references, and so on. The Harness features automatic compaction, but developers often need to balance “reducing tokens” and “retaining decisions and constraints” themselves, while also wishing to see the replacement results before modifying the context.

The following introduces the community plugin dsh-context-manager (GitHub: SkanderBog/dsh-context-manager). It adds a Context entry next to the session title and provides /context-manager in the command menu. It is designed to view usage, select Keep / Summarize / Omit by grouping history, and write to a checkpoint only after a confirmed preview. The plugin does not modify desktop source code, nor does it rely on additional background services or dedicated model tools.

What is this

dsh-context-manager is a standalone feature plugin for DeepSeek Harness 0.2.0-rc.2 and higher (current release version v0.2.0, MIT License). The maintainer is SkanderBog; it is categorized as “Memory” in the SkillHub community directory.

One-sentence positioning: Inspect and selectively compact DeepSeek Harness conversation context with reviewable checkpoints.

Core Features

Context Panel and Usage Breakdown

Upon opening Context, you can view the estimated context usage and its composition, including: instructions, user messages, assistant answers, stored reasoning, tool/file outputs, tool definitions, attachment references, etc.

The panel displays local context (session surface estimation by the Harness context meter) separately from the last reported model request (provider input/output counts from the most recent available usage). Missing usage is displayed as unavailable, not as 0.

If the current agent can see the acp_status tool, you can click Read ACP status to read the report via the Harness normal model tool and permission pipeline (no model request is initiated, with a timeout of approximately 10 seconds). This is compatible with the ACP boundary of projects like ranxianglei/billion-context, but does not require installing those projects.

Grouping Strategy: Keep / Summarize / Omit

For older history groups, you can select respectively:

  • Keep: Retain the complete exchange (including reasoning and tool pairing structure).
  • Summarize: Replace the entire “balanced” range with a plain text checkpoint.
  • Omit: Remove from the active context.

Protected content (which cannot be arbitrarily broken up by the above operations) includes: the latest round of exchange, system/developer instructions, Harness instruction/catalog/runtime snapshots, and unfinished tool exchanges.

The summary input is a new, tool-free text transcript: it does not contain reasoning, document content is marked as data, and the model is prompted to retain goals, decisions, constraints, verified results, paths, and unfinished work. The plugin does not rewrite reasoning or provider metadata on retained messages—this is to prevent adapter replay corruption due to missing reasoning signatures or complete tool-call/result pairs.

Tool Outputs and Decision Notes

Before generating a summary, you can configure the handling of recorded tool/file outputs: summarize, keep original text, or omit. “Keep original text” retains the output text recorded in the log; it does not re-read the disk or retain image pixels. Attachment images are not visually summarized; you need to keep the groups containing attachments.

Optional Add notes to preserve: Write decisions, rejected options and reasons, risks, or next steps for selected groups. Notes are attached as verbatim blocks to the reviewed checkpoint, and subsequent Context Manager summaries will retain legal note blocks and their sources. A single note is limited to 2000 characters; one summary range allows up to 32 notes totaling 16000 characters. Exceeding the limit will be rejected before calling the model.

Preview, Apply, and Compression History

The typical loop:

  1. Generate preview (summary requests may go through the model routed most recently in the current session; when marked with purpose: 'compaction', host plugins can route to a dedicated summarizer).
  2. Review the replacement text, notes, generation usage, and estimated local token changes.
  3. Check the review and then Apply (allowed only when the agent is idle).

Preview expires after approximately 10 minutes, upon generating a new preview, plugin reload, or session change; it does not alter the active context before being applied. Omit type previews do not call the model. After Apply, a standard Harness compaction event is written; the original log remains, but this version has no one-click undo. Keep is only effective for the current operation and cannot permanently pin against Harness automatic compaction.

Load compression history reads Harness standard compaction/summary records; View originals read-only displays messages corresponding to the source event ID (without restoring them to the model context). Long sessions feature pagination and character limits to ensure panel responsiveness.

Installation and Activation

The plugin targets the DeepSeek Harness plugin runtime, not the DeepSeek consumer chat application. package.json declares Node ^22.19.0 || >=24.0.0, as well as DSH >=0.2.0-rc.2 (the Store compatibility matrix also lists 0.2.1-alpha.1, 0.2.1-alpha.2, 0.2.1-rc.2).

The official README provides the following packaged installation method. First, download the archive from v0.2.0 Release, then execute (replace the profile name and paths with your environment):

dsh plugin --profile tauri add /absolute/path/dsh-context-manager-0.2.0.tgz

The community Linux desktop profile tested in the documentation is tauri; other desktop distributions may use desktop. You must exit the corresponding desktop before modifying reserved profiles; restart the Harness after updating plugins—reloading the frontend or switching components alone may leave imported host modules cached.

Some community desktop builds mistakenly delete local .tgz installations upon startup. The README suggests keeping the project directory on such builds, running npm ci and npm run build, and then installing using the directory path:

dsh plugin --profile tauri add /absolute/path/dsh-context-manager

The folder must be retained during installation. The SkillHub directory page currently marks CLI install/start/uninstall/rollback operations as unknown; please rely on the README and Release notes before installation.

Typical Usage

In an existing session:

  1. Click Context next to the title, or enter via the command menu /context-manager.
  2. View local context and composition; if necessary, click Read ACP status (if the agent possesses that tool).
  3. Set Keep, Summarize, or Omit for earlier history groups; configure the handling of tool/file outputs.
  4. If needed, Add notes to preserve on the groups.
  5. Click to generate a preview, verify the replacement text and token estimates, check the review, and Apply when the agent is idle.

If you only need to verify past compactions, use Load compression history and View originals without invoking the model again.

Use Cases and Notes

Suitable for: Long-session agent development, scenarios requiring manual review before context compaction, desire to retain structured decision notes, or distinguishing between “local history estimation” and “proxy-side effective input” when used with billion-context / ACP.

Permissions and Costs: Summary generation uses the configured LLM service in Harness and may incur provider usage; Omit-only previews do not call the model. Apply writes compaction events via Harness persistence. The plugin runs under the current DSH process permissions; before installation, read the source code, the Store compatibility and permissions table, and the MIT license to assess if it meets your environment requirements.

Category estimation uses fixed text heuristics from Harness; the sum of individual categories may not equal the total; CJK, tool schemas, and image pricing may not align with provider billing. Summary quality depends on the model; always review the preview before applying.

Links

The DSH ecosystem emphasizes “everything is a plugin”; SkillHub is an independent community site and has no official affiliation with DeepSeek / High-Flyer. If you are maintaining long sessions on Harness and need context management that is reviewable, noteable, and comparable against compression history, dsh-context-manager provides a manual compaction path that does not modify desktop source code.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye