rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
imlishiyuan/dsh-keep-running
A watchdog plugin for DeepSeek Harness: on a **quota / rate-limit (HTTP 429)** error, it automatically creates a fixed-interval scheduled task that keeps delivering a "continue the task" prompt until it succeeds or you take over. DeepSeek Harness 的 watchdog 插件:遇到 **配额/限流(HTTP 429)** 时,自动创建一个固定间隔的定时任务,到点持续投递「继续任务」的提示,直到任务成功或你手动接手。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:imlishiyuan/dsh-keep-running
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 简体中文
A watchdog plugin for DeepSeek Harness: on a quota / rate-limit (HTTP 429) error, it automatically creates a fixed-interval scheduled task that keeps delivering a "continue the task" prompt until it succeeds or you take over.
Depends on the official scheduled-task plugin. This plugin creates and deletes schedules through the
ctx.scheduleservice provided by@deepseek-ai/dsh-schedule, so you must mount it first — otherwise keep-running cannot register without that required service (see Dependency).
every schedule that periodically re-sends a "continue" prompt;/keep-running list and /keep-running cancel <id> (see Commands).⚠️ You must mount the official scheduled-task plugin
@deepseek-ai/dsh-schedule.
keep-running declares inject: ['commands', 'schedule'] and creates, reads, and deletes schedules through the ctx.schedule service, which is registered by @deepseek-ai/dsh-schedule. Mounting keep-running without it leaves the required service missing, so the plugin cannot register and the watchdog never works (the most common "it didn't work" cause).
Changed in DSH 0.1.7. Schedules no longer live in the session log's
schedule/changeevents; Host storage owns them andctx.scheduleis the only supported read/write path. Appendingschedule/changedirectly is no longer a supported write.
# A. Official command (backs onto pnpm; install pnpm first)
npm i -g pnpm
dsh plugin --profile web add dsh-keep-running
# B. Install with npm directly into the profile directory
cd ~/.dsh/profiles/web # Windows: C:\Users\<you>\.dsh\profiles\web
npm install dsh-keep-running --save
And install its dependency plugin into the same profile:
cd ~/.dsh/profiles/web
npm install @deepseek-ai/dsh-schedule --save
cordis.patch.yml. To load a plugin you must
insert it, not target an id (a bare - id: keep-running warns entry "keep-running" not found and does nothing). dsh-schedule must come
before keep-running:- insert:
- id: dsh-schedule
name: '@deepseek-ai/dsh-schedule'
- id: keep-running
name: 'dsh-keep-running'
config:
intervalSeconds: 1800 # task interval (seconds), min 300
continuePrompt: '请继续完成之前未完成的任务:{{task}}'
quotaKeywords: [] # empty = HTTP 429 only; add vendor terms as needed
dsh web and start a new session.| Key | Default | Description |
|---|---|---|
intervalSeconds |
1800 |
Task interval (seconds); the "continue" prompt is re-sent each tick. Minimum 300 |
continuePrompt |
请继续完成之前未完成的任务:{{task}} |
Prompt delivered each tick; {{task}} is replaced by the breakpoint (most recent user message, truncated to 200 chars) |
quotaKeywords |
[] |
Quota keywords (lowercase). [] means HTTP 429 only; add vendor terms to adapt other providers |
Default [] = only HTTP 429 (covering RATE_LIMIT / QUOTA codes and quota signals in code/message). For multi-vendor setups, add each provider's error terms:
config:
quotaKeywords: ['quota exceeded', 'requests limit', '5-hour usage quota']
The plugin registers its own namespaced /keep-running command (it does not collide with a future /schedule):
/keep-running list — list all active keep-running tasks in the current session (id, interval, breakpoint, next tick)./keep-running cancel <id> — cancel the task with that id (id from the list output).The command reads the ctx.schedule task list directly, without needing the model, so it works even while quota is exhausted.
agent/error: a quota 429 is rejected the moment the request is sent, so it flows through step()→turn()'s catch→throwError() and never reaches the agent/request-error waterfall (that fires only on a streaming error finish). The event that actually fires is the global agent/error, whose payload.error.failure is the LlmFailure carrying status.isQuotaError detects quota: HTTP 429, stable codes (RATE_LIMIT / QUOTA), or quota signals in code/message, plus quotaKeywords.ensureWatchdog calls ctx.schedule.create(..., { title: 'keep-running', every_seconds }) to create the schedule; an active guard prevents duplicates, and a task-list query recovers across process restarts.continuePrompt; when any turn closes normally (quota recovered) turn-stopping → stopWatchdog deletes it./keep-running list / cancel.npm install
npm run build # compiles src → lib/index.js
During development you can mount the compiled output via a file:// URL (still using the insert: form):
- insert:
- id: dsh-schedule
name: '@deepseek-ai/dsh-schedule'
- id: keep-running
name: 'file:///D:/ui-workspace/dsh-keep-running/lib/index.js'
config:
intervalSeconds: 1800
Adjust the URL to your checkout path.
dsh web
Confirm both plugins are mounted:
# Windows
dsh web --dump-config | findstr /C:"keep-running" /C:"dsh-schedule"
# Linux / macOS
dsh web --dump-config | grep -E "keep-running|dsh-schedule"
Seeing the keep-running and dsh-schedule rows with no not found warning means they are mounted.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。