dsh-auto-continue
A dual-face plugin for DeepSeek Harness (dsh) that adds two things to your chat composer:
- Auto-continue — when a request dies on
RATE_LIMITorQUOTA, the session automatically resumes once the quota/rate limit resets. - Idle task — during peak-price windows the running session is suspended; when the valley window starts it resumes by itself. Run your long jobs at off-peak prices without babysitting them.
Both are toggled by buttons in the composer input row, and a status line shows the current price window and time to the next switch. Toggles are persisted through the dsh settings service, so they survive a restart.
Install
dsh plugin --profile web add github:Meowrium/dsh-auto-continue
Then restart dsh web. The plugin is a bundle: it carries its own patch layer, so no manual cordis.patch.yml editing is needed.
Requires
dsh≥0.1.5-alpha.1(tested on0.1.5-rc.1). See Compatibility below.
Usage
After restarting, open a conversation. Two pill buttons appear in the input row:
| Button | Effect |
|---|---|
| 闲时任务 (idle task) | Peak windows: suspend running sessions. Valley windows: resume them. |
| 自动续跑 (auto-continue) | On RATE_LIMIT / QUOTA failures, retry automatically after the reset. |
When either is on, a status line is added under the composer, e.g. 谷价 · 距峰价 23分 · 自动续跑.
How it works
Peak / valley windows
All times are Beijing time (UTC+8, no DST). Peak is:
09:00 – 12:00 and 14:00 – 18:00
Everything else is valley.
- Entering peak — every running agent is cancelled with
{ keepInbox: true }(so nothing is lost), and new turns are intercepted onagent/pre-step: the already-claimed messages are pushed back onto the agent's inbox and the step is rejected. - Entering valley — every suspended agent receives a
followupnudge, so it picks the work back up. - Switching the idle-task toggle off immediately resumes everything that was suspended.
Boundaries live in a constant in lib/index.js:
const BOUNDARIES_SEC = [9 * 3600, 12 * 3600, 14 * 3600, 18 * 3600];
Change those to match your own price schedule.
Auto-continue
Hooks agent/request-error. If the failure code is RATE_LIMIT or QUOTA, a timed resume is scheduled using the provider's Retry-After value (providerRetryAfterMs), falling back to 60 s when absent and capped at 24 h. The current request ends normally — the session just continues afterwards.
Settings
Persisted in the dsh settings namespace auto-continue:
| Key | Type | Default |
|---|---|---|
idleTaskEnabled |
boolean | false |
autoContinueEnabled |
boolean | false |
Package layout
A single package serving both halves of the plugin:
package.json dsh.bundle.patch → cordis.patch.yml (inserts the host half)
dsh.client → lib/client.js (browser half)
cordis.patch.yml bundle patch: inserts entry { id: auto-continue, name: dsh-auto-continue }
lib/index.js host half — settings, timers, agent events
lib/client.js browser half — composer toggles + status line
Compatibility
- Does not import any named export from
@deepseek-ai/dsh-settings. Those (settingsNamespace,installSettingsSection) were removed in dsh0.1.2-alpha.1; a missing named export is a link-timeSyntaxErrorthat kills the whole plugin. Instead the settings service is obtained viactx.inject(["settings"])and itsinstallSection(...)method is used — the same approach as the first-partydsh-agent-default-model. - Browser half registers into
conversation.input.leftandconversation.composer.dockusingslots.inject(...), which is required from dsh 0.1.5 onward. - The browser module id equals the package name (
dsh-auto-continue), asdsh-client-moduleskeys client modules by loader entry name.
No comments yet. Be the first to write one.