Preface¶
When running agent sessions with DeepSeek Harness (DSH), the API is billed by time of day: peak prices are roughly double the off-peak rates. If you capture an idea or a to-do as a new session and execute it immediately at any time, you risk spending double during peak hours. A common workaround is manual note-taking and waiting for cheaper hours to start a session, but this often leads to missed tasks and makes batching difficult.
This article introduces the community plugin dsh-offpeak-inbox (maintainer: Tungpeng, Category: Workflow). It provides an “Off-peak Inbox” in the Web sidebar to capture titles and bodies, allowing the host to create actual DSH sessions for execution only when DeepSeek API rates are off-peak. It can also delay delivery of input box content to an existing session. The goal is straightforward: Don’t burn quota at peak prices; do the work during cheap hours.
What is this¶
dsh-offpeak-inbox is a Cordis plugin for DSH dsh web (package name dsh-offpeak-inbox, version 0.1.1 according to current sources, MIT license, requires Node >= 22). It does not alter DSH’s “everything is a plugin” architecture; it only adds inbox UI, scheduling logic, and local persistence within the Web process.
Plugin directory page: SkillHub — Tungpeng/dsh-offpeak-inbox (Community site, not officially affiliated with DeepSeek or 幻方). Source code and docs: GitHub — Tungpeng/dsh-offpeak-inbox.
Core Features¶
Sidebar Inbox: Capture and Auto-start Sessions¶
- Open the panel from the sidebar entry, fill in an optional title and body to capture a record.
- Upon capture, an earliest runnable time is written:
- Captured within an off-peak window → Enters the current window and starts later;
- Captured during peak hours or the gap between two peak periods → Waits until the next off-peak window to run. - Once the time arrives, the host creates a new DSH session, hands the captured text to that session for execution, and the results remain in the session for later review.
- Visible statuses in the list:
waiting/running/done/failed. Actions include Run now, Delete, and Retry after failure.
Long Lists: Collapsed History and Search¶
- Ongoing rows (waiting / running / failed) remain in the main list; failed rows are not collapsed to facilitate retry or deletion.
- Finished rows (done / cancelled) are moved under a
History (N)section that is collapsed by default; expanding it shows the recent 20 items first, and “show earlier” loads 20 more each time. The collapsed state is stored in the browserlocalStoragekeydsh.offpeak.historyOpen. - Data is not deleted by collapsing; full records are stored in
$DSH_HOME/offpeak-inbox/inbox.json(or~/.dshif$DSH_HOMEis unset). - The search box above the history bar searches all records (title, prompt, failure info, session id, status, capture date, scheduled time for waiting rows, etc.); hits are independent of collapsing. If there are too many results, they are paginated, 20 per page.
Deliver to Existing Session¶
If you do not want to start a new session, you can use the Off-peak button next to the input box:
- Clicked during peak: Content is staged and automatically sent to the current session at the next off-peak window, rather than being sent prematurely during peak hours.
- Clicked within an off-peak window: Sent immediately (the panel will indicate that prices are currently cheap).
- Only captures existing content in the input box at the moment you click; normal sending is unaffected.
- Upon successful delivery, the inbox shows “delivered to existing session \<session id>“, with status done; this is based on host acceptance receipt, not whether the session is still running.
- The panel also supports a Send to option to select any existing session (excluding subagent sessions), directing the entry to a different session.
The current session relies on the browser-persisted dsh.sessions.current (localStorage). If the page is freshly opened with no session or the value cannot be read, it will explicitly prompt that the current session cannot be identified rather than mis-delivering.
How the Off-Peak Calendar is Calculated¶
The plugin calculates based on DeepSeek’s published pricing calendar (peak is roughly double off-peak), defaulting to UTC for evaluating weekday peak periods:
| Type | Time Range (UTC) |
|---|---|
| Peak (Expensive) | Monday–Friday 01:00–04:00, 06:00–10:00 |
| Off-Peak (~Half Price) | All other times, including the entire weekend |
The panel header displays whether it is currently peak or off-peak, the current window boundaries, and when the next window starts, so you don’t need to calculate timezones manually.
Installation and Activation¶
Any installation method will write to the profile; restart dsh web after making changes for the host to read the plugin upon startup.
Pre-built tarball (No build during installation, no build authorization required):
dsh plugin --profile web add https://github.com/Tungpeng/dsh-offpeak-inbox/releases/latest/download/dsh-offpeak-inbox.tgz
Directly from GitHub repo (Runs prepare build; pnpm 10 may reject build scripts on first run, follow the prompt to add the package name to allowBuilds in the profile’s pnpm-workspace.yaml and run again; can pin to a commit via github:Tungpeng/dsh-offpeak-inbox#<sha>):
dsh plugin --profile web add github:Tungpeng/dsh-offpeak-inbox
npm (Sources note it is not yet published; currently use one of the two methods above):
dsh plugin --profile web add dsh-offpeak-inbox
Local development mount (Requires npm install or npm run build to generate lib/ first, otherwise dsh web may fail or hang when loading the plugin):
dsh plugin --profile web add link:<path to this repository>
Configuration¶
Adjustable in cordis.patch.yml (Excerpt from source material):
| Key | Default | Meaning |
|---|---|---|
enabled |
true |
Master switch; if off, still captures but does not start |
timeZone |
UTC |
IANA timezone for evaluating peak periods |
ranges |
01:00–04:00, 06:00–10:00 | Weekday peak periods, can be changed to your billing framework |
announceToAgent |
true |
Whether to announce the plugin to the agent via a system-prompt section |
launchIntervalSeconds |
10 |
Launch attempt interval (seconds, min 2); starts at most one session per round to control backlog digestion speed (old name tickSeconds is still accepted) |
executionTimeoutSeconds |
14400 |
If execution takes too long, mark as failed and point to the session |
Typical Usage¶
- Queue for cheap runs: Thought of a research or script task during peak hours? Write the title + prompt in the sidebar inbox; status becomes
waiting. It automatically becomesrunningand opens a new session during the off-peak window. Check results inHistoryor the original session once done. - Don’t start a new thread: Typing in a session but don’t want to send during peak? Click Off-peak; when the window opens, the content goes into the current session (or a session specified via Send to in the panel).
- Failures and backlog: Use retry for a
failedentry; if there are multiple waiting entries,launchIntervalSecondsstarts them one by one to avoid launching multiple sessions simultaneously.
Use Cases and Boundaries¶
Who it’s for: Developers who use DSH Web long-term, care about DeepSeek API peak/off-peak price differences, and want to “note now, run later” or “delay delivery to existing sessions.”
Important to know:
- The host must be running. The plugin runs inside the
dsh webprocess; if the process stops, no scheduling occurs. - Missed windows are not replayed; however, the earliest runnable time is fixed upon capture, so entries are not lost, just waiting for the next window.
- It will not wake up a sleeping machine; if the computer is asleep when the time comes, execution will not happen.
- Execution still consumes real API quota, same as normal sessions; what is saved is the rate difference (off-peak is ~half of peak), not zero cost.
- The plugin runs with the permissions of the current
dsh webprocess; please review the source code and license yourself before installing. The community directory page shows 0 stars in the source material, which does not represent a quality conclusion, but serves merely as an ecosystem index.
Conclusion¶
dsh-offpeak-inbox binds “capturing ideas/to-dos” with “starting sessions or delivering only at off-peak prices.” The sidebar, search, history folding, and the Off-peak button on the composer cover both paths: queuing new sessions and continuing existing ones. If you want to control API time-based costs in your DSH workflow, you can install via the pre-built tarball and try capturing a task in the sidebar after restarting dsh web.
- Directory Page: https://www.skillhub.cn/plugins/Tungpeng/dsh-offpeak-inbox
- GitHub: https://github.com/Tungpeng/dsh-offpeak-inbox