DSH (DeepSeek Harness) developers often face context window overflow issues when building long conversations or complex workflows. The dsh-plugin-om plugin manages context using Observational Memory to solve this problem.

This plugin is maintained by FanetheDivine.

Features

The plugin provides the following capabilities:
* Automatically compresses main session history and merges summaries again if they become too large.
* Generates summaries through tool loops, preserving user messages, system messages, and uncompressed content.
* Preserves the original text of tool-loaded and manually loaded skills, and confirms them again before compression.
* Uses recall to review original messages by message index and recall-semantic for local semantic retrieval.
* Records the compression process, duration, and token usage.
* Displays compressed conversation records in the subagent list and downloads them together with the parent session’s Session log.
* Displays compression results, errors, and degradation warnings in the browser.

Installation and Prerequisites

The plugin requires DSH 0.2.0-rc.2 or later.

Install it by running the following command:

dsh plugin --profile <profile> add dsh-plugin-om

After restarting DSH, check whether the configuration has been loaded.

If installation fails with pnpm 11, set allowBuilds: true in the profile’s pnpm-workspace.yaml, or allow builds for onnxruntime-node, protobufjs, and sharp.

Configuration

Open the row configuration page for dsh-plugin-om in the WebUI plugin sidebar, or edit $DSH_HOME/profiles/<profile>/cordis.patch.yml. Configuration supports hot reloading; $DSH_HOME defaults to ~/.dsh.

- id: dsh-plugin-om
  config:
    observeThresholdTokens: 35000

The main configuration options are as follows:

Configuration Default Description
observeThresholdTokens 35000 Observation compression threshold
reflectThresholdTokens 40000 Summary merge threshold
tailMessageCount 20 Number of full messages retained after a trigger
compressMaxTokens Model default Per-generation limit
compressProvider Session routing Compression provider; must be configured together with compressModel
compressModel Session routing Compression model; must be configured together with compressProvider
compressReasoningEffort Model default Reasoning effort
compressSkipReasoning true Whether to ignore reasoning
rateLimitWaitMs 60000 Wait milliseconds after a 429 response; 0 means no waiting
modelDir DSH shared directory Embedding model directory
omEnabled true Whether to enable automatic compression
recallEnabled true Whether to enable original message recall
semanticRecallEnabled true Whether to enable semantic recall
debug Enabled in development Whether to output step logs

A smaller observation threshold saves context sooner, while a larger threshold provides more summary information. Set compressSkipReasoning to false only when reasoning contains critical decisions.

Typical Usage

  1. Open the row configuration page for dsh-plugin-om in the WebUI plugin sidebar, or edit the configuration file.
  2. Set observeThresholdTokens to control compression frequency.
  3. Call the recall tool in the conversation to review original messages by message index, or use recall-semantic for local semantic retrieval.
  4. View compression results, errors, and degradation warnings in the browser.

Notes

  • A smaller observation threshold saves context sooner, while a larger threshold provides more summary information.
  • Set compressSkipReasoning to false only when reasoning contains critical decisions.
  • If installation fails with pnpm 11, set allowBuilds: true in the profile’s pnpm-workspace.yaml, or allow builds for onnxruntime-node, protobufjs, and sharp.
  • The plugin runs with the permissions of the current DSH process; check the source code and license before installing.

Conclusion

By using automatic compression and original message recall, this plugin helps DSH developers manage long-conversation context. Refer to the directory page and the GitHub repository for more information.