DeepSeek API uses time-of-day based billing. Daily in Beijing Time, 09:00–12:00 and 14:00–18:00 are peak hours (higher prices); all other times are off-peak hours. Operating directly in the DSH Web GUI can easily lead to unintentionally completing high-cost tasks, especially when using high-priced models such as DeepSeek V4 Pro.

This plugin is designed to address this issue: it persistently displays the current billing period and provides a second confirmation when using specific models during peak hours.

Core Features

Persistent Peak/Off-Peak Badge
The plugin persistently displays status below the input box in the DSH Web interface (conversation.composer.dock). A green dot indicates off-peak hours, an orange dot indicates peak hours, and it also displays the real-time Beijing Time and the peak-hour range, automatically refreshing every 30 seconds.

Peak-Hour Secondary Confirmation
When all of the following conditions are met, the plugin pops up a confirmation before task submission (first step):
1. The current time is during peak hours (Beijing Time 09:00–12:00, 14:00–18:00);
2. The model used in the current session is DeepSeek V4 Pro;
3. It is a newly submitted turn (sub-agents, tool continuation steps, or retries will not trigger repeated popups).

Popup Options
The user can choose:
* Continue: Start the task immediately with the current configuration.
* Do not remind today: Continue, and do not show popups for the remainder of the day. This state is written to the browser localStorage, persists across restarts, and automatically expires at midnight Beijing Time.
* Cancel this run: Do not execute the task for this run; the turn ends as blocked, and the message remains in the conversation.

Fully Fail-Open
Any determination error (such as a missing popup component, session exception, or model read failure) results in fail-open behavior: the request proceeds directly and does not block a running task.

How It Works

The plugin intercepts the DSH Host-side agent/pre-step event to determine whether a popup should appear, and uses webServer to perform same-origin communication between the host and the browser to synchronize state.

  • Host side: During the agent/pre-step phase, it evaluates the current time, model, and the “do not remind today” state. If the conditions are met, it calls userQuestions.ask to show the prompt.
  • Client side: It renders the peak/off-peak badge in composer.dock and listens for page load or connection reset events to synchronize the browser’s “do not remind today” state to the host.
  • Time zone: Peak/off-peak detection uses Beijing Time (UTC+8), calculated independently by the Host and Client, independent of the system timezone setting.

Installation

  1. Clone the repository locally:
    git clone https://github.com/Heldea-xianmiao/dsp-deepseek-peak.git
  1. In your DSH profile (for example, $DSH_HOME/profiles/web), add the dependency and bundle to package.json:
    {
      "dependencies": {
        "dsp-deepseek-peak": "link:<本仓库的绝对路径>"
      },
      "dsh": {
        "profile": {
          "bundles": [ /* ...原有列表... */, "dsp-deepseek-peak" ]
        }
      }
    }
  1. Run pnpm install in the profile directory, then restart DSH.

Or use the official command:

dsh plugin --profile web add file:/path/to/dsp-deepseek-peak

Customization

The plugin source code is located in the lib/ directory and can be modified according to your needs:

What to change Where to change
Peak/off-peak hours (for example, change to 08:00–10:00) isPeakNow() in lib/index.js and isPeak() in lib/client.js
The model that triggers the popup (for example, only V4 Pro) isDeepseekV4Pro() in lib/index.js
Popup copy/text The options and question in askConfirmation() in lib/index.js
Badge refresh interval (default 30s) window.setInterval(..., 30000) in lib/client.js

Restart DSH after making changes for them to take effect.

Privacy and Compatibility

Privacy Note
The plugin runs purely locally. All computations (peak/off-peak detection, model detection, and popups) happen in your own DSH host and browser, and no data is uploaded. The browser side uses only localStorage to store a date string. The Host and Client communicate via DSH’s built-in webServer over the local loopback address.

Compatibility
Depends on host services: agentDefaultModel, userQuestions, webServer, and agents.
Compatible with DSH Web profiles (rc.6+).

Summary

This is a practical plugin designed for DSH Web users, aiming to help developers avoid unintentionally triggering high-cost DeepSeek V4 Pro tasks during peak hours through visual reminders and interaction interception.