Preface

When working with long sessions in DeepSeek Harness (DSH), the context window gradually fills up with historical messages. While the host triggers native automatic compaction as capacity limits are approached, developers are often unclear about “how much is left,” “should I manually compact first,” or “when to start a new session and carry over the state.” The community already offers various compaction and handoff plugins, each focusing on different strategies or alert methods.

Below is an introduction to dsh-compact-relay (Compaction Relay), published by maintainer cfanzx: It places a 28px circular indicator next to the desktop input box, reflecting usage rates and compaction evaluation status in real-time. It executes compaction or a 9-section session handoff only after user confirmation. The plugin is categorized under “Memory” in the community directory. The current version is 0.3.3, released under the MIT license, and the repository has approximately 3 stars on GitHub.

What is this

dsh-compact-relay is a plugin for DSH 0.2.x, positioned as an “Input box context status indicator and session manager.” It does not replace DSH’s native compaction mechanism; instead, it reads thresholds, visualizes capacity, provides preview-and-confirm compaction, as well as structured handoffs and message locking. Default parameters are adapted for DSH 0.2.x. It mounts next to the existing input box without altering the current operational workflow.

Indicator Ring and Status Meanings

The indicator ring displays colors in segments based on compaction evaluation logic, marking the suggested compaction point, locked message positions, and the DSH native automatic compaction line (default reads compaction-basic.thresholdRatio, i.e., 80%).

Visual Meaning
Gray Arc Below the minimum compaction threshold; compaction is not recommended yet.
Blue Arc The normal capacity range is full; manual compaction can be performed to release space.
Amber Arc (with gap) Exceeds the compaction decision point; the gap indicates the suggested compaction point. Click to preview estimates.
Red Arc Reaches the handoff threshold; generating a 9-section handoff and switching to a new session is recommended.
Purple Tick DSH native automatic compaction line.
Magenta Block Distribution of locked messages within the history.
Full Ring Flashing Red Exceeds the native automatic compaction line; host automatic compaction is about to be triggered.

Hovering the mouse allows viewing used capacity, cumulative compaction count, current operational suggestions, compaction decision point, native automatic compaction line, and the number of locked messages.

Core Functions

Status Visualization Monitoring

The plugin subscribes to session projection data and continuously updates the usage rate next to the input box. When the native automatic compaction line is crossed, the entire ring flashes red, facilitating proactive handling before automatic compaction is triggered.

Preview and Confirm Compaction

Compaction does not rewrite history without confirmation. Executing /bc (or via the indicator ring menu) allows viewing the scope to be compacted, message count, and estimated capacity to be released first. It executes after confirmation; canceling leaves records untouched. Messages locked with /pin are automatically skipped during compaction.

Structured Session Handoff

Executing /handoff generates a handoff document containing nine standard sections: Overall Goal, Constraints, Completed Items, Current Progress, Involved Files, Key Decisions, Known Issues, Incomplete Items, and Next Steps. The plugin creates a new session in the current workspace, injects the document, and switches to it, while the original session is fully preserved.

Key Message Locking

/pin and /unpin mark messages that must be preserved during compaction. Locked items appear as magenta blocks on the indicator ring and as locked rows in the menu list.

Installation and Enablement

Environment requirements: DSH Desktop or dsh web 0.2.x (tested on 0.2.1-rc.2 according to the README), Node.js 22+ (following the DSH bundled runtime). Restart DSH is required after installation; internal plugin configuration takes effect immediately upon saving without requiring another restart.

Installation via npm package name:

dsh plugin --profile desktop add dsh-compact-relay

For the desktop version, you can also enter the package name in Plugins → Add Plugin. To install from GitHub:

dsh plugin --profile desktop add github:cfanzx/dsh-compact-relay

The plugin runs with the permissions of the current DSH process. Before installation, it is recommended to review the source code and MIT license at the GitHub Repository to ensure compliance with your security and compliance requirements.

Settings

Configuration entry: Settings → Compact Relay (located within the account menu for DSH 0.2.1+).

  1. Compaction Prompts: Minimum compaction line, compaction reminder line, handoff reminder line; controls alert timing.
  2. Compaction Behavior: Summary retention count limit, recent raw text retention token count, handoff document storage directory.
  3. DSH Native Automatic Compaction: Reads the host’s current threshold; can toggle native automatic compaction (automatically generates a backup before modifying the profile; takes effect after restart).
  4. Colors and Appearance: Five base colors, derived for light/dark themes.
  5. Help / About & Dangerous Operations: Legend, feedback entry, version and config path, restore factory defaults.

Plugin status is saved in ~/.dsh/compact-relay.json, and handoff documents are in ~/.dsh/handoffs/. Everything is purely local with no external sync.

Typical Usage

Command Function
/bc Preview compaction: scope, count, estimated capacity to be released.
/bc confirm Execute the previewed compaction.
/handoff 9-section handoff document + create and switch session.
/pin / /unpin Lock or unlock messages.
/bctest Small-scale dry run (for development debugging).

Recommended workflow: Observe indicator ring color → Use /bc to preview and confirm when amber, or /handoff to handoff when red → Use /pin for context that must be retained.

Use Cases and Notes

Suitable for developers working on long tasks next to the DSH desktop input box who need visible capacity and “preview before compaction.” Summary quality depends on the chosen model. The plugin includes a 9-section template, format validation, and single retry, but does not guarantee output quality.

Functional boundaries (explicitly stated in README):

  • Does not replace host compaction; only provides a native compaction switch in settings, focusing on alerts and display.
  • Only replaces corresponding history when the user confirms compaction or performs a handoff; does not tamper with prompts or model replies.
  • The ring indicator, /bc, and /handoff rely on the desktop input box and slash commands; they are not loaded in headless mode or bridges like QQ / WeChat. Sending /bc in these links will be treated as a normal message.
  • The current interface is in Simplified Chinese; the English interface is in future plans with an undetermined schedule.

Conclusion

dsh-compact-relay consolidates context usage, compaction judgment, and handoff thresholds into a single ring next to the input box. It uses preview confirmation and message locking to reduce the risk of erroneous compression, and uses the 9-section /handoff to relay state across long session boundaries. Community Directory Page: cfanzx/dsh-compact-relay; Source Code and Issues: github.com/cfanzx/dsh-compact-relay.