Repository navigation
Releases
Releases · quaner1234-cmd/dsh-subagent-watchdog
v0.1.0 — auto-continue-once recovery for max-tokens subagents
First public release. Published on npm as dsh-subagent-watchdog@0.1.0.
What it does
When a native continuable DSH subagent ends with explicit stopReason: 'max-tokens', Watchdog automatically continues that same child conversation exactly once, using official DSH seams only:
- observes the terminal
turn/end { kind: 'max-tokens' }; - starts one official
ctx.sessions.flush(childSession)durability checkpoint while the child session is live; - allows normal settlement, waits for checkpoint resolution;
- sends exactly one official
subagents.followup()cold-resume of the same durable child conversation.
A second failure (max-tokens again, or an explicit runtime/provider error) stops intervention and delivers one notice to the delegating parent with the official manual options. Never loops.
Boundaries
- Continuable subagents only;
max-tokensis the only automatic trigger - At most one automatic continuation per child task/recovery chain
- Normal completion, clean aborts, refusals, unknown stop reasons: untouched
- Provider/model errors: reported, never auto-retried
- No timers, no polling, no custom persistence, no private runtime APIs
Install
dsh plugin --profile <profile> add dsh-subagent-watchdogZero dependencies, no build step, Node >= 20. Live-tested against @deepseek-ai/dsh 0.1.1-rc.2 only.
Evidence summary
- 38/38 deterministic scenarios over both shipped artifacts (
node --test test/watchdog.test.mjs) - Final packaged live run: real
max-tokenssettlement, one durable continuation marker, the same durable child session id cold-resumed under a fresh runId, healthy completion - Checkpoint-before-followup ordering and genuine
AbortSignalplumbing are supported by prior instrumented probes plus the deterministic suite; they were not independently emitted as records in the final packaged trace (see README > Verification and evidence)