dsh-context-compactor: A Context Compaction & Summarization Plugin for DeepSeek Harness

kusesad-1122/dsh-context-compactor

Sessions & MessagesVerified
Listed on 2026-08-18
Page last updated 2026-09-16

DSH context compactor plugin: auto-detailed summarization at 80% usage, guaranteed token reduction, overflow auto-recovery, with /compact and /context-status commands and one-click buttons above input.

dsh-context-compactor is a context compaction and summarization plugin built for DeepSeek Harness, solving the problem of request failures when long conversations approach the model window limit. It automatically generates a detailed Chinese summary via LLM when context usage reaches 80%, compressing earlier history while preserving core information, and verifies that token usage truly decreases after compaction. It auto-recovers from context-overflow errors and prunes oversized tool results. A toolbar above the input box offers one-click compress and prompt-enhance buttons, along with commands like /compact and /context-status, making context management simple and intuitive.

How to Install

install
dsh plugin --profile web add github:kusesad-1122/dsh-context-compactor
Category
Sessions & Messages
Platform
DSH Plugin
Author
kusesad-1122
Distribution
Plugin

dsh-context-compactor Key Features

Auto-summarize at 80%Verified token reductionOverflow auto-recoveryTool result pruningOne-click compact & enhance
Listed on dsh-plugin.org

dsh-context-compactor Repo Summary

What Does It Do?

dsh-context-compactor is a DSH plugin for DeepSeek Harness that compacts and summarizes conversation context to manage token usage. It solves the problem of requests failing when the conversation approaches the model's context window limit, by summarizing older messages into a detailed checkpoint while preserving core information. Key capabilities include automatic triggering at 80% usage, post-compaction token verification, context-overflow recovery, oversized tool result pruning, and quick-action buttons above the input box.

Core Features

  • Automatic summary compaction: at 80% of the model window, it uses an LLM to compress earlier history into a detailed Chinese checkpoint, keeping only the most recent 16% of raw conversation.
  • Post-compaction guarantee: verifies totalTokens strictly decreases after each compaction, with additional attempts if needed.
  • Context-overflow auto-recovery: when the provider reports context length exceeded, it summarizes, compacts, and retries the request, up to 2 times by default.
  • Tool result pruning: trims tool outputs over 8192 characters to head and tail, avoiding harsh truncation of conversation history.
  • Input toolbar: shows real-time context usage percentage, with 'Compress Summary' and 'Prompt Enhance' buttons for one-click actions.
  • Manual commands: /compact, /enhance-prompt, and /context-status for immediate compression or status checks.

How to Use This Plugin?

After enabling it in DSH, the plugin automatically listens for agent creation and mounts the compaction engine, working without extra configuration. When context usage reaches 80%, it triggers detailed summarization automatically; you can also click the 'Compress Summary' button above the input box or type /compact to compress manually. Use /context-status to view current token usage, window size, and threshold. To adjust trigger ratio or retention ratio, modify thresholdRatio and retainRatio in the config file, or set modelPolicies for specific models.

This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: kusesad-1122/dsh-context-compactor. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.

Install, update, and uninstall this plugin in the Plugin Market of DeepSeek Harness's DSH Plugin Hub

DSH Plugin FAQ