dsh-precise-cache: Display a 5-Decimal-Place Cache Hit Rate Beside the DSH Web GUI Statistics Bar

Preface

When running conversations with DeepSeek Harness (DSH), there is a built-in stats bar below the chat input box where the cache hit rate is rounded to the nearest integer. Even if the actual hit rate has already reached 99.5%, the UI will still display 100%, making it difficult to tell whether the prompt cache is truly “saturated.”

The community plugin dsh-precise-cache (maintained by Townrain, category: Client) reads the same data but presents a different level of precision: it adds a line with five decimal places next to the stats bar, for example Precise hit 99.87654%. Below we cover what problem it solves, how to install it, and things to keep in mind during use.

What It Is

  • Name: dsh-precise-cache (same npm package name)
  • Version (package.json): 0.2.0
  • License: MIT
  • Scope: A client-side plugin for the DSH Web GUI; the host-side lib/index.js is an empty implementation, and all readings are rendered entirely in the browser
  • Data: Uses the same tokenUsage projection as the Harness built-in stats row; the denominator is uncachedInputTokens + cacheReadTokens + cacheWriteTokens, consistent with official stats — no extra requests are made and billing numbers are not modified

The DSH ecosystem follows the convention of “everything is a plugin.” The plugin directory at skillhub.cn and DeepSeek / High-Flyer have no official affiliation. The facts in this article are based on the repository README and manifest.

Core Features

  1. Five-decimal hit rate: No integer rounding; displays the true ratio directly (the README notes that five decimal places is a deliberate choice to avoid the illusion of “looking like 100%” when too few digits are shown).
  2. UI placement: Inserted via the conversation.composer.dock slot, right after the built-in stats row; the label uses locale: 'preciseCache'.
  3. Compatibility: engines.dsh is >=0.1.5-rc.1; dsh.client.platform is web; the bundle supports darwin, linux, win32, and wsl.
  4. Startup safety: The browser factory does not export a module-level inject; instead it uses runtime ctx.inject, avoiding the situation where a missing dependency service causes the entire cordis entry to remain in PENDING and prevents dsh from starting (see the repository’s “Technical Details”).

Installation & Activation

The install script places the plugin into the dsh plugin directory and writes the configuration; running it repeatedly will not register it twice. After installation, you need to restart dsh and refresh the browser page.

Windows (PowerShell, no npx required)

Open PowerShell and paste the following:

irm https://raw.githubusercontent.com/Townrain/dsh-precise-cache/main/scripts/install.ps1 | iex

If you need to specify a profile or force an override, you can download the script first and then run it with parameters, for example:

pwsh -File scripts/install.ps1 -Profile headless
pwsh -File scripts/install.ps1 -Force

Other methods

If npm is installed:

npx dsh-precise-cache install

Install from this repository directory using Node:

node scripts/install.js install --from . --force

Uninstall

PowerShell:

irm https://raw.githubusercontent.com/Townrain/dsh-precise-cache/main/scripts/install.ps1 -OutFile "$env:TEMP\dsh-precise-cache-install.ps1"
& "$env:TEMP\dsh-precise-cache-install.ps1" -Uninstall

Then restart dsh. You can also use:

npx dsh-precise-cache uninstall

Typical Usage

After installation and refreshing the page, once input billing data has been generated, a line similar to the following will appear next to the stats bar:

Precise hit 99.87654%

If you don’t see this line yet: the README explains that it is automatically hidden when there is no data; you can simply send any message first, then come back and check the stats area.

Use Cases & Notes

Who it’s for

  • Developers or agent builders who frequently observe token / cache stats in the DSH Web interface
  • Those who need to distinguish between “displayed as 100%” and “actually slightly below 100%” in cache hit situations

Performance & Billing

  • The plugin only reads the stats that dsh is already computing; the README explicitly states that it will not slow down dsh or affect billing.

Security & Permissions

  • The plugin loads with the current dsh process; before installing, it is recommended to review the GitHub source code and the MIT license to confirm it aligns with your environment policy.

Hot Reload

  • After modifying lib/client.js, simply refresh the page; if you change the dsh.client declaration, a dsh restart is required.

dsh 0.2.0 layout

  • When 0.2.0 changed the composer dock to horizontal flex-wrap: nowrap, the reading may end up squeezed onto the same line as the stats bar; the plugin uses CSS to allow the dock to wrap, bringing the reading back below the stats bar (see README Technical Details).

Closing

The built-in stats bar with integer percentages is sufficient for most use cases; if you want to see a cache hit rate that is sourced from the same data as the official stats but not rounded in the same interface, dsh-precise-cache fills that gap with a single dock reading. Directory page: https://www.skillhub.cn/plugins/Townrain/dsh-precise-cache; source code and installation instructions: https://github.com/Townrain/dsh-precise-cache.

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

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

Xiaoye