Introduction¶
When using DeepSeek Harness (DSH), the official API often experiences increased billing or resource contention during weekday peak periods (e.g., 9:00–12:00 and 14:00–18:00). The dsh-peak-block plugin is designed to automatically intercept requests sent to deepseek-official during these periods, avoiding unnecessary costs or queueing, and to use the configured third-party or local endpoint instead.
What Is It¶
This is a DSH plugin maintained by better-er that intercepts official API requests during peak periods. Its core value is automated routing cutover or request blocking to maintain resource availability.
Core Features¶
The plugin intervenes in the agent/request flow through host half-duplex mode, and mainly completes the following:
- Intercept official requests: It matches
deepseek-officialexactly and does not mistakenly intercept prefixed third-party relays. - Provider switching: Once
targetProvideris configured, it redirects the request to the target adapter. - Peak/off-peak detection: It automatically determines peak periods based on weekdays and the holiday list.
Installation and Activation¶
After the plugin is installed, DSH mounts it automatically. Restart the Web interface for the change to take effect.
Install from GitHub:
dsh plugin --profile web add github:better-er/dsh-peak-block
Install from npm:
dsh plugin --profile web add dsh-peak-block
Configuration¶
Configuration items are injected through cordis. The core settings are targetProvider and peakWindow.
| Key | Default | Description |
|---|---|---|
enabled |
true |
Overall switch |
targetProvider |
empty | Target provider to switch to after interception; if left empty, block and display a prompt |
peakWindow |
Weekdays 9:00–12:00 and 14:00–18:00; weekends and statutory holidays are off-peak | Peak/off-peak time window; can be overridden globally or partially |
Configuration example:
plugins:
dsh-peak-block:
enabled: true
targetProvider: opencode-go
peakWindow:
days: [1, 2, 3, 4, 5]
hourRanges: [[9, 12], [14, 18]]
weekendOffPeak: true
Scope And Limitations¶
- Interception scope: Only the
agent/requestpath is intercepted; paths such ascompactionare not intercepted. - Provider requirement:
targetProvidermust be an adapter route already registered in DSH; otherwise, the switch fails withNO_ADAPTER. - Time zone determination: Time zone determination uses pure UTC+8 mathematical conversion and is independent of the system time zone.
- Holiday list: The built-in statutory holiday list is for 2026, based on the State Council’s holiday arrangement and totaling 33 days. These days are always off-peak and cannot be overridden by
peakWindow.