In the development of DeepSeek Harness (DSH) Web, context window management is a core pain point. The built-in context display in DSH usually provides the percentage used by entire segments and lacks fine-grained visibility into how individual messages consume context. dsh-ballast is a client-side plugin designed to address this pain point. It uses the host’s token meter to display token usage and body summaries for the current surface by message entry, helping developers identify which entries are consuming the window.

Core Features

The plugin mainly provides the following capabilities:

  • Per-entry attribution: Lists user messages, assistant messages, and tool results by token usage. Body text is collapsed for whitespace and then truncated; tool results display the tool name. Reasoning blocks and images are counted only; their original content is not inlined.
  • Price and price delta: Displays the current routing price. If the host also provides a heuristic shadow price, the price delta is shown (note: the price delta indicates that images may have been re-priced using visual tokens, not that an anomaly has occurred).
  • Aggregate statistics: Shows token proportions aggregated by message type. It also shows the heaviest entry in each live session on the current host.
  • Window pressure estimation: Displays provider usage, window pressure for the next request, and the estimated composition of system/tools/messages. Note: the estimated composition and provider usage are based on different anchors, and the panel does not sum them.
  • Session list: Lists the sessions on the current host. This includes live sessions within the process, as well as stored sessions without a live agent. When a session title is missing, the workspace directory name and session ID are shown.

Installation and Enablement

Install the plugin by running the following command:

dsh plugin --profile web add dsh-ballast

After installing and restarting DSH Web, open ballast from the dsh-mini-utility-dock launcher in the lower-left corner of the page.

Usage Instructions

The panel provides two main views:

  • Current session: View the current surface entry by entry, including usage, type, time, and summary. Old append entries that have been collapsed by compaction replace are not displayed.
  • Cross-session Top: On demand, measures each live session on the current host once and sorts by the heaviest entry. This view also lists stored sessions without a live agent, sorts them by on-disk size, and provides their context pressure from their respective projection caches.

The plugin retrieves data through the same-origin read-only interface /dsh-ballast/api, supporting endpoints such as sessions, measure, top, and cold.

Use Cases and Precautions

  • Read-only mode: This plugin is read-only. It does not estimate costs, modify sessions, trigger compaction, write state, or delete messages.
  • Environment dependencies: Requires DSH 0.1.5-rc.3 or higher. Hosts without a mounted Connection fall back to local guard mode, determining access based on the TCP peer, Fetch Metadata, Origin, and loopback Host.
  • Data sources: Log entry counts, byte counts, and revisions come from persisted snapshots; token numbers come from projection caches; titles come from a single batch log read.

It is suitable for developers who need to monitor context usage in real time on the Web side, analyze message entry weights, and troubleshoot window overflow issues.

References