Missher DSH Context Manager: Session Context Viewing and Pre-request Compression

Preface

When running long tasks in DeepSeek Harness (DSH), the context grows continuously with the dialogue, tool outputs, and summaries. With a limited window, it is difficult to judge between “continuing to pile on raw text” and “compressing history early” without knowing what is currently in the context, how many tokens have been consumed, or whether compression has actually saved space. The host’s built-in Basic compression and community plugins can coexist, but their respective ledgers and thresholds are not automatically merged.

The following introduces the client plugin Missher DSH Context Manager (npm package @missher/dsh-context-manager) released by maintainer Missher12. It inserts the Context Manager and a read-only Inspector in the form of a Cordis Bundle without modifying the DSH desktop Host source code or relying on additional compatibility plugins; it compresses history based on policies before model requests and displays context composition, usage, and compression records in the interface.

What is this

  • Repository & Directory: GitHub — Missher12/Missher-DSH-Context-Manager; Community directory page SkillHub — Missher-DSH-Context-Manager (Independent site, no official affiliation with DeepSeek / High-Flyer).
  • Classification: Client (dsh.client.platform is web, injecting UI modules such as settings, sessions, and model selection via Cordis patch).
  • Delivery Form: kind: package-bundle, patch file is cordis.patch.yml; License is MIT (see repository package.json).
  • Current Documentation Version: README indicates candidate 0.10.2; SkillHub directory page shows installable v0.10.2. The same README also states that 0.10.2 is not yet released and cannot be downloaded from Releases or installed via published assets—please refer to Releases and PUBLICATION.md before installation. The published 0.10.0 includes settings page refinements and session K/M Token readings; 0.10.1 only fixes the numeric input layout.

The core problem the plugin solves: viewing context composition, summary sources, and usage attribution within DSH sessions, and compressing history by threshold before the request is sent; it can also perform idle cleanup after the task ends normally (requires host interfaces listed in README). It is not a compression implementation for Codex or Claude Code, nor is it the desktop application itself; see Missher-DeepseekHarness-Desktop for the desktop entry.

Core Features

Current Session Usage & Cost Preview

Click “Peak / Off-peak” next to the conversation input box to see the recorded tokens for the current session, peak and off-peak costs, and estimated totals, without manual token entry. Each settlement uses its own recorded model, route, and time period; cost totals cover all readable settlements and are not affected by the “last 200 details” display limit. Estimates use official reference prices verified on 2026-10-20, not historical actual bills; if usage, model prices, or time periods are missing, it will clearly indicate partial or excluded amounts.

Inherited Context Management Capabilities

The README summarizes engine-side capabilities into A–E (behavior for local.8 and later is subject to the current page description):

  1. A Format Normalization & Structure Repair: Strictly checks checkpoint structure; only locally wraps the original value when it can be determined that an “array field was mistakenly written as a single string”, without increasing model calls. Other structural errors are still rejected and the original text is preserved; formatRepairEnabled controls whether to enable this local repair.
  2. B Working Set Growth & Continuation Headroom: Dynamically maintains the working set and continuation headroom, checking full occupancy and feasibility before initiation and submission.
  3. C State & Usage Accounting: Dispatched and und dispatched states are separated; not_dispatched is not counted towards unknown usage, and dispatched but incomplete returns still retain the unknown status.
  4. D Versioned Checkpoints: Sections format is context-manager/3, requires explicit selection; JSON remains the default. Structural validity does not imply semantic fidelity.
  5. E Tool Result Load Reduction: Only processes complete successful foreground Bash plain text that meets the restrictions; default is observe (only measures and records, does not change host results). Explicitly selecting “Safe Reduction” (toolResultsMode=reduce) will rewrite: raw text is written to a read-only archive first, while other tools, failed, or incomplete results are preserved as is; no guarantee of actual token or cost savings.

Compact Context View & Runtime Details

The actual model is displayed next to the context title; the main session figures are displayed in K/M Tokens, with percentages supplementing the proportion, cache hits, and savings. Runtime details are collapsed by default, listing only six common facts; full diagnostics require clicking to copy. The panel displays two compression records and three valid content items by default, with body text and sources expanded as needed.

Tool Result Reduction & Raw Text Archive (0.10)

When reduce is enabled, the plugin first writes the raw text to the read-only archive directory .context-manager-archive under the profile, then publishes the short text; only when the host’s final result retains the short text is the reference counted as confirmed. Unconfirmed, withdrawn, and confirmed are displayed separately. The default raw text blob quota is 512 MiB (statistics sum the stored bytes of raw text records; when the quota is exhausted, only new reductions are disabled, existing raw text is not deleted). Compressed or reduced raw text can be read back via pagination using the same-session tools context_history_search and context_history_read (single scan and output limits can be adjusted in settings, subject to the tool’s own output limits).

Capacity & Timeout (Default for New Installations)

New installations allocate capacity based on model window percentages by default (local.5 criteria): recent raw text 10%, summary output 4%, format repair 1%, subject to protocol and model safety limits (e.g., recent raw text 128000, summary 32768, repair 8192 Token limits); small windows are rounded down, and summary or repair outputs less than 256 Tokens will not trigger the corresponding calls. Old token absolute budgets are not automatically migrated; you must explicitly “switch to percentage and remove old absolute limits” in the settings page and save.

Long summaries use adaptive time limits by default: total hard limit for the entire compression 600 seconds, wait for first valid output 120 seconds, output stall limit 180 seconds. Configurations lacking summaryTimeoutMode are still read as fixed; only after the user switches to “Wait based on output progress” and saves will adaptive be enabled.

Relationship with Host Basic Compression

The Bundle only inserts Context Manager and a read-only Inspector; it does not snapshot or rewrite the host preset. Basic works according to its own thresholds, costs, and ledger; Context’s “2 main summaries / 4 calls” limit does not cover Basic, nor does it promise that all windows will only be compressed once. The Host’s provider registration capability v1 only affects enhanced provider registration; missing capabilities will not automatically replace or disable the Host’s Basic.

Installation & Enablement

The materials do not provide a fixed one-line installation command like dsh plugin add …; please do not construct one yourself based on the repository name. Please check the version and installation method via the following paths:

  1. Open GitHub Releases and the repository’s PUBLICATION.md to confirm currently installable release assets (README states 0.10.2 candidate has not been released as a Release asset).
  2. If using the Missher desktop distribution, refer to Missher-DeepseekHarness-Desktop and the homepage link on the directory page.
  3. When the community directory SkillHub marks it as an installable client plugin, follow the installation instructions displayed on its page (The DSH ecosystem philosophy is “everything is a plugin”, the directory site is community aggregation, not an official app store).

The package has peer dependencies on Cordis / DSH components (excerpt, see package.json for full scope):

"@deepseek-ai/cordis": "^4.0.0 || 4.0.5-alpha.1",
"@deepseek-ai/dsh-agent": ">=0.2.0-rc.2 <0.2.1-0 || >=0.2.1-alpha.2 <0.3.0-0",
"@deepseek-ai/dsh-compaction": ">=0.2.0-rc.2 <0.2.1-0 || >=0.2.1-alpha.2 <0.3.0-0"

Please read the source code and the MIT license before installation; the plugin runs with the current DSH process permissions and will read and write session and archive data under the profile.

Typical Usage

View Current Session Tokens & Estimated Costs

In a session where the plugin is enabled, click “Peak / Off-peak” next to the input box to view the current session tokens and peak/off-peak cost estimates. The layout can refer to the repository documentation images (Synthetic demo data, not personal bills):

  • Narrow screen: docs/images/context-session-cost-narrow.png
  • Desktop width: docs/images/context-session-cost-desktop.png

Adjust Context Management & Capacity

Go to Settings → Context Management:

  1. Check whether the capacity is percentage or old absolute Token; if local.5 default ratios are needed, migrate and save according to the page prompts.
  2. If summaries are still stuck at a fixed 90 seconds, check if you have switched to “Wait based on output progress” and saved the three adaptive time limits.
  3. Tool results: Keep observe by default; only set to toolResultsMode=reduce and adjust input limits, minimum savings, and other rules after understanding the archive and “Confirmed / Unconfirmed / Withdrawn” rules.

Read Back Compressed or Reduced Raw Text

Call the host-exposed context_history_search and context_history_read in the session (the plugin provides logic and budgets, does not write to MSE, and does not access other sessions). Pagination parameters and single scan limits are adjustable in settings; forked sessions can only read authorized raw text within the inherited prefix, and will report incomplete when exceeding boundaries.

Manual Emergency Relief After Quota Exhaustion (Historical Behavior Description)

Documentation for historical versions like 0.10.0-local.4 describes a “pre-check for one manual relief (no model call)” process after automatic quota exhaustion: the pre-check does not call the model or trim raw text; after confirmation, each batch of history gets at most one additional manual summary, and consumption records are preserved across restarts. See Release Notes for upgrade and storage domain context_manager_emergency. The current candidate version behavior is subject to the 0.10.2 description at the top of the README.

Applicable Scenarios & Notes

Who it is for: Developers who need to run Agents in DSH for a long time, want to see context composition and usage clearly, and proactively compress history or optionally reduce Bash tool output before requests. It is also suitable for integration verification against the README when coexistence with Basic compression is needed and separate Context and Basic ledgers are accepted.

Important Notes:

  • The plugin does not modify Host source code, but injects client modules via Bundle; check the repository and license before installation, and understand persistent data like .context-manager-archive within the profile.
  • Costs and Tokens are mostly estimates or known lower bounds; “No records” and “Reported zero usage” are displayed differently in the UI.
  • Multi-turn semantic replays for 100K etc. use fixed fact oracles and synthetic summaries for budget arithmetic verification, not a proof of summary quality for any arbitrary real model.
  • The README declares that verification includes synthetic tests, type checking, builds, and cross-platform storage CI etc.; this does not represent your actual results on your local machine’s model bills.
  • GitHub stars are 0 (Directory clue); features and versions are subject to the repository README / PUBLICATION.

Conclusion

Missher DSH Context Manager brings “seeing the context clearly” and “compressing before requests” into the same Cordis Bundle: On the session side, there are K/M Tokens, compression records, and peak/off-peak cost previews; on the engine side, it retains format local repair, working set feasibility checks, hierarchical usage accounting, and optional Bash tool result reduction with raw text archiving. If you are selecting a DSH client plugin on SkillHub or GitHub, you can enter from the Directory Page and check the currently installable Releases and PUBLICATION instructions at Missher12/Missher-DSH-Context-Manager.

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

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

Xiaoye