Preface¶
When running long tasks in DeepSeek Harness (DSH), two types of “timing mismatches” are common: entering DeepSeek’s official peak hours on weekday mornings, where unit prices are higher; or approaching account balance exhaustion, where continuing to run risks an interruption. A forced stop loses context, while running blindly either costs more money or runs out of control when the balance hits zero.
dsh-tide is a community workflow plugin. It allows the agent to wrap up at a recoverable safe point when switching from off-peak to peak hours or when the balance is too low, leaving handovers for both human and machine. Once the balance recovers, a watchdog automatically wakes the agent to resume. The usage and boundaries are explained below under positioning, capabilities, installation, and configuration.
What is this¶
- Name & Maintenance: GitHub repository wobenshiwomu/dsh-tide, maintained by wobenshiwomu; community directory page SkillHub Entry, categorized as workflow.
- One-liner: A DeepSeek Harness plugin — Graceful Pause on Timing: peak-hour reminders (15-second window), graceful degradation shutdown on low balance, watchdog auto-wake to resume; dual human-machine handovers, full logging.
- Skeleton: Two chains share the same pattern — Pause → Dual Handover → Conditional Wake; the mechanism is based on the public DSH API, and the author has stated in the README that it has been verified item-by-item in the local DSH source code.
Core Functions¶
Part 1: Peak-hour Reminder (Gentle Event, Optional for User)¶
When switching from off-peak to peak, a user-visible reminder is injected into the most recently active session: replying “Pause” within 15 seconds allows for a graceful wrap-up (leaving a handover first, waiting for cheaper hours to continue); no reply proceeds as usual.
- User replies “Pause” → The model writes two handovers (one for the human + one for the model) → Calls
submit_pause_handoffto persist → The session enters “Paused”. - Timeout defaults to continue: The 15 seconds is a window to “catch the person present,” not a forced cost saving; designed as an opt-in mechanism.
- Never Ask mode: Silently skips, no disturbance.
Default peak hours are Beijing Time Monday–Friday 09:00–12:00 and 14:00–18:00. These can be overridden via peakWindows, and support a leadMinutes advance notice.
Part 2: Balance Degradation (Dangerous Event, Forced Handling)¶
When the balance is ≤ lowBalanceCNY (default ¥5), a degradation wrap-up instruction is injected into the active session (no user consent required). The model writes the dual handovers and stops.
Watchdog: After pausing, it polls the balance according to watchdogSeconds (default 15 minutes); when it recovers above resumeBalanceCNY (default ¥20), it automatically wakes the model to continue the task, injecting the model handover text with the wake-up message. If the recovery line is not reached, it stays paused without repeated disturbance.
Wrap-up Artifacts & Auditing¶
| Stage | Description |
|---|---|
| Human-readable Handover | Working directory TIDE-PAUSED-handoff.md (includes archives) |
| Model Handover | $DSH_HOME/storages/dsh-tide/handoffs/<session>.md, injected upon waking |
| Balance Query | GET {baseUrl}/user/balance (Bearer, key via ctx.credentials or environment variable fallback) |
| State | In-memory state machine + state.json; inquiry window/pause flags can be rebuilt from session logs |
The source.tide field in the session log records audit subtypes: ask, consent, decline, expired, wrap, paused, woken, resumed, etc.
During wrap-up, guardWhileWrapping (default true) can be enabled to intercept “starting new battlefront” type tools (such as job_, create_goal, subagent, etc.) using denyPattern.
Installation & Enablement¶
The plugin runs with the permissions of the current DSH process; it is recommended to read the repository source code and MIT license before installation to confirm the behavior fits your environment.
Direct GitHub Installation (Recommended in README, codeload directly accessible domestically, no npm account needed):
dsh plugin --profile web add 'https://codeload.github.com/wobenshiwomu/dsh-tide/tar.gz/v0.1.0'
GUI: Sidebar “Plugins” → Add Plugin → Enter the URL above. Restart DSH after installation to take effect. The last segment v0.1.0 in the URL is the version tag; for upgrades, simply replace it with the new version tag of the repository and reinstall.
Local/Development Installation:
dsh plugin --profile web add /path/to/dsh-tide
Environment Requirements (from package.json): Node ^22.19.0 || >=24.0.0, DSH >=0.2.0-rc.1.
Ready to Use: Writing no configuration applies the built-in peak windows, balance trigger line ¥5 / recovery line ¥20, and 15-minute watchdog polling. The following configuration should only be written into the profile user layer cordis.patch.yml if you need to change default behavior.
# Example: Only needed if changing defaults (trigger line 5 / recovery line 20)
- id: dsh-tide
config:
lowBalanceCNY: 1 # Low balance trigger line (CNY)
resumeBalanceCNY: 3 # Balance recovery line (CNY, must be greater than trigger line)
# peakWindows: ['1-5 09:00-12:00', '1-5 14:00-18:00']
# leadMinutes: 0 # Peak reminder lead time (minutes)
# askTimeoutSeconds: 15 # Reminder validity (seconds)
# watchdogSeconds: 900 # Watchdog polling interval
The trigger line must be less than the recovery line (low < resume); equality or inversion may cause a “pause again immediately after waking” loop, and a configuration reminder will be printed at startup.
Typical Usage & Configuration Points¶
No daily operation is required: At the start of peak hours, if the session is within the active window (default last 720 minutes), a 15-second window reminder is received; if the balance hits bottom, it automatically wraps up and pauses, and the watchdog wakes it after the balance recovers.
When customization is needed, common keys include:
| Key | Default | Description |
|---|---|---|
askEnabled |
true |
Master switch for peak-hour reminders |
balanceEnabled |
true |
Master switch for balance degradation |
askTimeoutSeconds |
15 |
Reminder reply window |
watchdogSeconds |
900 |
Watchdog interval after pause (seconds) |
tickSeconds |
10 |
Host tick interval |
For a complete list of optional keys, see the repository README configuration table (including peakWindows, balancePollSeconds, storageDir, etc.).
The repository provides simulation tests: npm install followed by npm test (README states 89 assertions, covering clock/windows/consent/dual handover/watchdog/cross-restart/cross-process).
Use Cases & Notes¶
Suitable for: Long-time unattended or headless agent runs where you want a chance for manual pause before peak hours, or automatic persistence of handovers on low balance rather than a hard break; requires automatic resumption after balance recovery, and accepts the default peak hours as a “Monday–Friday” work calendar (holidays are not modeled, so legal holidays during the day may still be treated as peak; the deviation leans conservative).
Boundaries & Coexistence (Known boundaries from README):
resolveAgenttakes over the session; multiple instances (web + headless) sharing the same session may cause lock conflicts, while single instances are unaffected.- Does not rely on the native
ask_user_questiontimed mode; architecturally homologous withdsh-calmand can coexist. - Wrap-up quality depends on the model; if
submit_pause_handoffis not called, it will not be marked as “Paused”.
The DSH ecosystem philosophy is “Everything is a plugin”; SkillHub etc. are community directories, with no official affiliation with DeepSeek / High-Flyer.
Links¶
- Community Directory: https://www.skillhub.cn/plugins/wobenshiwomu/dsh-tide
- Source Code & Docs: https://github.com/wobenshiwomu/dsh-tide
dsh-tide turns “pause on ebb tide, return on flood tide” into an inheritable dual handover and conditional wake-up. It is suitable for unifying the handling of peak-hour and balance timing within DSH workflows via a plugin, rather than forcing a hard stop or blindly continuing mid-task.