ScreamingMaggot/rcs-context: Long Conversation Collapsing and Read-only Investigator

Introduction

DeepSeek Harness (DSH) adopts a plugin-based architecture. In long conversations, the context window can grow rapidly, causing repetitive information (such as tool results) to consume a large number of tokens. RCS (StateCompiler) addresses this problem with a “compression + verification” approach: on one hand, it cuts redundant token cost in long conversations by half; on the other hand, it gives the model a read-only investigator that verifies the history before taking action.

What Is It

RCS is a DSH plugin package maintained by ScreamingMaggot, integrating context compression, external reasoning, append-only logging, and a Web panel. It reduces redundant token cost in long conversations by approximately half and equips the model with a read-only investigator.

Core Features

This plugin includes the following modules:

  • CONTEXTinjector: context injection and folding. Supports tool result folding, single compression, and double compression.
  • EXTREASON: external reasoning. Calls a read-only sub-agent for each conversational turn to perform verification.
  • LOGcompiler: append-only logging. Transcribes conversations to log files.
  • contextinjector-webui: Web panel. Provides an injection control interface.
  • toolfold: tool result folding. Compresses tool results in the history.

Installation and Activation

Installation only writes to $DSH_HOME; it does not modify system directories, PATH, or shell configuration.

Method 1: Install as a plugin package (recommended)

dsh plugin --profile web add github:ScreamingMaggot/rcs-context

After installation, the bundle must be activated manually. Edit <DSH_HOME>/profiles/web/package.json, add "rcs-context" to dsh.profile.bundles, and then restart dsh web. The startup log should show four loading lines ([CONTEXTinjector] armed, [logcompiler], [EXTREASON] armed, [contextinjector-webui] ready).

Method 2: Use the installation script

powershell -ExecutionPolicy Bypass -File ./install.ps1

The script backs up the current setup, deploys the plugin, appends the patch idempotently, and performs self-verification.

Usage

  1. Restart the service: You must restart dsh web for the changes to take effect (refreshing the page alone is not enough).
  2. Configure the compression level: Open a session, and in the Injection tab in the sidebar, select a compression level:
    • Tool folding: preserve the original information.
    • Single compression: perform semantic compression on AI output.
    • Double compression: perform key-value faithful extraction on top of single compression.
  3. Logging: Logs are written by default to $DSH_HOME/state-compiler/transcripts/<sid>.log.

Cost and Configuration Tips

The compression channel (single/double) follows the session model by default, which is billed at the main model’s price. It is recommended to point the compression channel to a local model (such as Ollama) to reduce cost. The EXTREASON sub-agent is enabled by default, runs with a read-only toolset, and does not require separate configuration.

Permissions and Dependencies

  • Permission boundary: The plugin only writes to $DSH_HOME. It does not install background services or register startup items.
  • Network requests: The plugin itself does not initiate network requests unless you explicitly configure a compression model (such as Ollama) or the host enables web search.
  • Compatibility: Compatible with dshTarget 0.2.0-rc.2.

Uninstall

uninstall.ps1

References

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

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

Xiaoye