lucagiftzek/DSH-Idle-Watchdog ↗★ 0
dsh-idle-watchdog
DeepSeek Harness (DSH) plugin: nudge opted-in chats when they go idle (quiet hours, backoff, goal-aware, error-only mode, preview), plus a secret-protected HTTP API to prompt any chat from scripts, cron or webhooks.
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lucagiftzek/DSH-Idle-Watchdog說明文件
閱讀完整 README ↗Configuration
Everything is in Settings, Idle Watchdog, and persists in the dsh-idle-watchdog namespace of ~/.dsh/settings.yaml (hand-editable, applies live). If the settings service is unavailable, the plugin falls back to ~/.dsh/idle-watchdog/settings.json; /status reports which store is active.
| Setting | Meaning | Default |
|---|---|---|
enabled | Master switch (per-chat opt-in is still required) | true |
idleMinutes | Minutes of silence before a nudge (1 to 10080) | 20 |
maxNudges | Nudges per idle period; your reply refills the budget (0 to 20, 0 = never nudge) | 3 |
tickSeconds | How often the watchdog scans (5 to 3600) | 30 |
defaultPrompt | Text posted when a chat has no prompt of its own | a short English nudge |
notifyOnCap | Post one folded notice when the cap is hit | true |
chats | Watched chats: id, label, enabled, prompt (override), idleMinutes (override, 0 = global) | none watched |
api.secret | Shared secret for the prompt API; unset means the API fails closed | unset |
api.rateLimitPerMinute | Prompt calls per minute per source IP (1 to 600) | 30 |
wakeColdForApi | API may resume a chat that is not currently loaded | true |
skipWhenGoalActive | Never nudge a chat whose goal-round driver is armed and active | false |
onlyAfterError | Nudge only after the agent reported an error since the last human message | false |
backoffFactor | Window multiplier per nudge sent in a period; 2 doubles the wait each time (1 to 10) | 1 (constant) |
backoffMaxMinutes | Upper bound on the backed-off window; 0 = no bound | 0 |
quietHours.enabled | No idle nudges inside the daily window below | false |
quietHours.start / .end | HH:MM, may wrap midnight (22:00 to 07:00) | 22:00 / 07:00 |
quietHours.timezone | IANA zone such as Europe/Berlin; blank = server local time | blank |
The behaviour options added in 1.1 (skipWhenGoalActive, onlyAfterError, backoff, quiet hours) default to the old behaviour, so upgrading changes nothing until you opt in. Quiet hours delay nudges only; the external API is never blocked by them.
Example settings.yaml fragment:
dsh-idle-watchdog:
enabled: true
idleMinutes: 15
maxNudges: 4
backoffFactor: 2
backoffMaxMinutes: 120
skipWhenGoalActive: true
quietHours: { enabled: true, start: "23:00", end: "07:00", timezone: "Europe/Berlin" }
chats:
- { id: session-abc123, label: Overnight refactor, enabled: true, prompt: "", idleMinutes: 0 }
Nudge semantics
A watched chat is nudged when all of these hold: the master switch is on, the chat is enabled, its agent is live and idle (a running turn is never interrupted), no active goal round if skipWhenGoalActive is on (needs the goals service; if your DSH lacks it the option is a no-op), an error was seen if onlyAfterError is on, the cap is not reached, the silence since the last append of any kind (including the watchdog's own previous nudge) exceeds the window (multiplied by the backoff for the n-th nudge), and quiet hours are not active. A human message resets the counter and the error flag. Reaching the cap posts one folded notice (not a fake user turn) and waits for you. Cold chats are never woken for idle reasons; only the API can wake them.
State survives restarts (~/.dsh/idle-watchdog/state.json, atomic writes). The audit ledger is ~/.dsh/idle-watchdog/activity.jsonl (rolling, 512 KiB).
Seeing what happens next
The Status card in Settings shows, per watched chat, the next nudge time or the reason it is held (running, goal active, quiet hours, cap reached, waiting for an error), the last outcome and the nudge count. The same data is a read-only endpoint, so you can preview without sending anything:
curl -sS http://127.0.0.1:3080/dsh-idle-watchdog/api/next