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.

Package
dsh-idle-watchdog
Compatibility
Unverified
Version
1.1.0
License
MIT
Last updated
Oct 31, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lucagiftzek/DSH-Idle-Watchdog

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.

SettingMeaningDefault
enabledMaster switch (per-chat opt-in is still required)true
idleMinutesMinutes of silence before a nudge (1 to 10080)20
maxNudgesNudges per idle period; your reply refills the budget (0 to 20, 0 = never nudge)3
tickSecondsHow often the watchdog scans (5 to 3600)30
defaultPromptText posted when a chat has no prompt of its owna short English nudge
notifyOnCapPost one folded notice when the cap is hittrue
chatsWatched chats: id, label, enabled, prompt (override), idleMinutes (override, 0 = global)none watched
api.secretShared secret for the prompt API; unset means the API fails closedunset
api.rateLimitPerMinutePrompt calls per minute per source IP (1 to 600)30
wakeColdForApiAPI may resume a chat that is not currently loadedtrue
skipWhenGoalActiveNever nudge a chat whose goal-round driver is armed and activefalse
onlyAfterErrorNudge only after the agent reported an error since the last human messagefalse
backoffFactorWindow multiplier per nudge sent in a period; 2 doubles the wait each time (1 to 10)1 (constant)
backoffMaxMinutesUpper bound on the backed-off window; 0 = no bound0
quietHours.enabledNo idle nudges inside the daily window belowfalse
quietHours.start / .endHH:MM, may wrap midnight (22:00 to 07:00)22:00 / 07:00
quietHours.timezoneIANA zone such as Europe/Berlin; blank = server local timeblank

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