Preface¶
When running agents on DSH (DeepSeek Harness), DeepSeek applies peak/off-peak time-based pricing. Checking “how much was spent today” or “what is the remaining balance” often requires switching to other interfaces. While there are many community client plugins that display balance or estimate daily consumption, most rely on console data or fixed display logic; if a number is calculated incorrectly, the common workaround is a manual reset or a restart. The dsh-peak-chip introduced below (maintained by sunsun320) places Today’s Consumption and Current Balance into a dot at the header of the conversation; clicking it opens a panel. One of its key design focuses is Self-Repair—if the plugin fails, the agent within the current session can repair it following a local manual. On the billing side, through filtering, date-boundary re-anchoring, and explicit error lines, it strives to let incorrect numbers correct themselves, saving you from repeated manual resets.
What is this¶
dsh-peak-chip is a client-side plugin within the DSH ecosystem (primarily for the DSHA / Android WebView mobile variant; the README specifies that the Windows desktop client is not adapted). It injects a dot indicator light into the conversation header. Clicking it expands a panel showing two core numbers: Today’s Consumption and Current Balance. The details also include the first observed balance of the day, today’s recharge identification, local token audit values, the “Unable to Audit” difference, and three-tier error alerts.
In one sentence, the accounting caliber is: calculate the local token-converted value L and the balance-change-inferred value S = max(0, V + T) separately; the difference is split into “Unable to Audit” (consumption by other clients on the same account, which is normal) and “Error” (suspicious only if the local machine over-calculates). Recharge identification is performed by the host side via balance step detection (median 3-window filtering + consecutive window confirmation). For complete formulas, see 计费算法说明.md in the repository.
The plugin is a third-party work and not an official DeepSeek product. The GitHub repository sunsun320/dsh-peak-chip currently has approximately 1 star, is licensed under MIT (© 2026 deepseekV4.1Flash), and the package version is 4.1.8.
Core Features¶
In-session Indicator Light and Panel¶
- Dot: Attached to the conversation header, serving as the visual entry point for peak/valley and consumption status.
- Panel Numbers: Today’s Consumption and Current Balance.
- Details: First observed balance of the day, current balance, today’s recharge identification, local audit, “Unable to Audit,” “Error,” and corresponding alert tiers.
DeepSeek’s pricing varies with peak and off-peak periods; this plugin places “how much spent today” and “how much left” into the current conversation context, reducing the need to switch pages to check accounts.
Self-Repair: Fix it via Agent Reading Local Manual¶
At the very bottom of the panel details is a “One-Click Repair” button. Clicking it fills the current session input box with a “Repair Contract” (fills only, does not auto-send). You need to send it manually, and the agent you are using will read the 维修手册.md (Repair Manual) inside the plugin directory and complete the process according to the manual. The general flow is:
- First clarify “what happened” (symptoms, time, whether recharged/changed model/changed settings, expected behavior); do not run tests or flip through code immediately.
- Then diagnose: evidence, root cause, proposed changes; modify code only after your confirmation.
- Modify code, sync price lists, and upgrade
RULE_VERSIONif necessary. - Update documentation and tests according to Manual §〇, write to
开发日志.md(Development Log), write to故障记录/(Fault Log), and package only after tests pass. - If it cannot be fixed, honestly conclude it as “Known Unrepairable” rather than pretending it is fixed.
The Release package (.tgz) contains the complete source code (host and client), repair manual, six sets of tests, package.json, and cordis.patch.yml. Repair does not depend on logging into GitHub or cloning source code separately. If the entire client plugin crashes and the button is unavailable, you can send the local path of 维修手册.md directly to the agent.
Honest boundary: If the client side fails entirely, this button will also disappear (similar client plugins are often affected as well).
Self-Correction on the Numbers Side (No Manual Reset Needed)¶
The README emphasizes that unlike similar plugins that “only display, and rely on humans to reset when wrong,” this plugin implements multi-layer fallbacks at the algorithm and state machine levels:
- Misjudged Recharges are Revoked: Temporary recharges participate in display but are not persisted; if subsequent window balance evidence does not support them, they disappear automatically (documentation example: phantom recharge lines can revert from numbers to
—). - Yellow Light Hysteresis: Entering alert requires ≥0.6, exiting requires <0.4, both requiring 3 consecutive windows; the yellow light automatically recovers after the water level drops.
- Zero Carry-over at Date Boundary: Re-anchored at midnight, yesterday’s errors are not carried into today.
- Gray State Has an Exit: Only turns gray after 3 consecutive days of red (semantics: billing caliber is no longer valid); the only regular exit is a rule version change, avoiding silent permanent lock-up.
- Credential Fetch on Demand: No need to restart the plugin when changing API keys; if the DSHA 3090 bridge is missing, only the “Recharge” button is degraded; the panel and accounting work as usual.
Precision Trade-off: Only Uses API Key, Does Not Read Console¶
The author explains: Some billing plugins read the official website console directly, which aligns more closely with official details; this plugin does not take this path—tests show that for this account, out of 12 endpoints, only /user/balance and /models return 200, while /user/usage returns 404. Console data is not available via the Open Platform API. Reading the console usually requires a web login state (Cookie/Token), which has a different permission surface and revocability compared to API keys.
This plugin’s choice: Official Balance Differential + Local Token Audit. It only uses the DeepSeek API key configured in your dsh settings (the plugin does not store the key) and does not touch the login state. The panel uses “Unable to Audit” and “Error” rows to lay open the uncertainty, rather than providing seemingly precise but unverifiable numbers.
Installation and Activation¶
Install from the GitHub Release attachment (the installer does not execute build scripts; the plugin is zero-build, with lib/client.js as a pre-built single file):
dsha-plugin import dsh-peak-chip-4.1.8.tgz
Direct link to the release package:
https://github.com/sunsun320/dsh-peak-chip/releases/download/v4.1.8/dsh-peak-chip-4.1.8.tgz
After installation, restart dsh web and refresh the page in your browser.
Peer dependencies include @deepseek-ai/dsh-credentials, @deepseek-ai/dsh-settings (^0.1.5-rc.2), etc.; the README verification environment is DSHA 0.1.5-rc2 / dsh 0.1.5-rc.2, arm64, Android mobile WebView (mobile variant).
Typical Usage¶
- Configure the DeepSeek API key in DSH (the plugin reads it via dsh credentials and does not store it itself).
- Import
dsh-peak-chip-4.1.8.tgzusing the command above, then restart and refresh the Web interface. - Open any conversation: look at the dot color/status in the header; click the dot to view Today’s Consumption, Balance, and details.
- If you need to initiate a recharge via the DSHA bridge, the local 127.0.0.1:3090 bridge must be available; without the bridge, the recharge button is degraded, but other functions remain available.
- If display anomalies or plugin behavior anomalies occur: prioritize using One-Click Repair at the bottom of the panel (or manually hand
维修手册.mdto the agent); normally, just pay attention to the error and “Unable to Audit” rows on the panel to judge if things are normal.
For details on accounting and alert logic, as well as threshold parameters, refer to 计费算法说明.md, 声明.md, and 依赖.md in the repository.
Contact Surface, Boundaries, and Applicable Scenarios¶
Permissions and Data (Check Source Code Yourself Before Installing)¶
- Read:
$DSH_HOME/.bridge_token(used only for the DSHA bridge). - Connect:
api.deepseek.com(balance; credentials from dsh settings),127.0.0.1:3090(only for the “Recharge” button). - Write: Settings namespace
dsh-peak-chip(balance, today’s consumption, recharge identification, debug windows, its own path, etc.). - No Telemetry: Does not upload conversations or device identifiers to third parties.
The plugin runs with the permissions of the current dsh process; before installation, you should read the repository source code and the MIT license to confirm the contact surface is acceptable.
What it Definitely Does Not Do¶
- Does not replace official billing; numbers are all local audits and balance inferences, and errors are explicitly displayed.
- Does not modify model routing, does not modify pricing parameters, does not auto-recharge.
- Windows desktop client is not adapted (no 3090 bridge, sleep/wake behavior not covered).
Who is it For¶
- Developers who mainly use DSH for conversations on DSHA / Android WebView and want to see today’s consumption and balance within the session.
- People who can accept the precision of “API Balance Differential + Local Token Audit” and are willing to look at the Unable to Audit / Error rows on the panel.
- Users who hope that when the plugin has issues, it can be fixed locally by an agent + repair manual, and that the Release package comes with tests and documentation.
Not suitable for scenarios requiring details perfectly consistent with the official website console, or requiring the same experience on Windows desktop dsh (README states it is not adapted).
Documentation and Community Entry Points¶
| Resource | Link |
|---|---|
| SkillHub Directory Page | https://www.skillhub.cn/plugins/sunsun320/dsh-peak-chip |
| GitHub Repository | https://github.com/sunsun320/dsh-peak-chip |
| Release v4.1.8 | https://github.com/sunsun320/dsh-peak-chip/releases/download/v4.1.8/dsh-peak-chip-4.1.8.tgz |
The DSH community plugin directory (such as SkillHub) has no official affiliation with DeepSeek / High-Flyer. Before selecting third-party plugins, it is recommended to judge whether it matches your environment by combining 声明.md, 故障记录/, and local testing (the repository contains six sets of tests including v4-alert, v4-client, v4-drift + sync).
Through the steps above, you can use a small dot in the mobile DSH session to continuously contrast Today’s Consumption and Balance, and when numbers or plugins are abnormal, prioritize relying on its Self-Repair design and explicit error calibers, rather than repeated manual resets or blindly trusting console-level precision.