dshbase

插件目录 / Developer / dsh-subagent-watchdog

dsh-subagent-watchdog

未验证 quaner1234-cmd

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
语言
2026-08-24最近推送
跨平台平台

功能简介

DSH plugin that auto-continues a native continuable subagent once when it ends with explicit max-tokens termination — then stops. No loops, no timers, official seams only.

我们的评价
未验证 — 尚未实测

DSH plugin that auto-continues a native continuable subagent once when it ends with explicit max-tokens termination — then stops. No loops, no timers, official seams only. 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-subagent-watchdog

A DSH plugin that safely recovers native continuable subagents from one high-confidence failure: explicit max-tokens termination.

When a native continuable DSH subagent ends because it hit max-tokens, Watchdog automatically continues the same child conversation once, then stops. No loops.

Why

When you delegate a task to a continuable subagent in DSH and the child runs out of output tokens mid-task, the runtime ends the turn with stopReason: 'max-tokens', reports the failure to the delegating agent, and stops. The work sits unfinished; the parent has to notice the failure, decide it is recoverable, and manually continue the child.

Watchdog does exactly that one recovery — deterministically, at most once — using only official DSH seams.

What it does

  • First max-tokens on a continuable child — Watchdog observes the terminal turn/end { kind: 'max-tokens' }, starts one official durability checkpoint (sessions.flush) while the child session is still live, waits for normal settlement and checkpoint resolution, then sends exactly one continuation through the official subagents.followup() seam. The same durable child conversation cold-resumes in a new activation epoch with a short instruction to continue the unfinished task from its existing state.
  • Recovered run completes normally — Watchdog stays silent. No messages, no markers, nothing further.
  • Second failure (max-tokens again, or an explicit runtime/provider error) — Watchdog stops intervening and delivers one notice to the delegating parent with the failure facts and the official manual options (manual send_message, interrupt_agent, or re-delegating a fresh subagent).
  • Never recovered — one-shot subagents (DSH exposes no resume seam for them), normal completion, clean aborts, refusals, unknown future stop reasons, and any first-seen outcome that is an error rather than max-tokens. Provider/model errors are reported, never auto-retried.
  • No persistence / unverifiable children — recovery decisions verify the child's durable log through the official persistence seam when available; a child whose continuable mode cannot be verified is skipped, never guessed. Without durable session logs the restart-safe "already continued" marker cannot be consulted across restarts, so protection there rests on the process-lifetime guard alone.

The continue-once guarantee is enforced against the child's durable session id (stable across activation epochs) plus a continuation marker written into the child's own durable log — repeated events, plugin restarts, or duplicate settlements cannot cause a second automatic continuation.

Install

Through the ordinary DSH plugin path (verified on dsh 0.1.1-rc.2):

dsh plugin --profile <profile> add dsh-subagent-watchdog

or from a local tarball:

npm pack
dsh plugin --profile <profile> add ./dsh-subagent-watchdog-0.1.0.tgz

The package declares dsh.bundle.patch; dsh plugin add reconciles it into the profile's bundle stack automatically. Zero dependencies, no build step, Node >= 20.

Safety and non-goals

  • At most one automatic continuation per child task/recovery chain.
  • max-tokens is the only automatic recovery trigger.
  • No timers, no polling, no custom persistence, no private runtime APIs — official seams only.
  • No second LLM deciding whether recovery is needed; no dashboard, no DAG, no team manager, no heuristic stuck detector.

Compatibility

Live-tested end-to-end against @deepseek-ai/dsh 0.1.1-rc.2 only. No broader compatibility is claimed or tested.

Verification and evidence

  • Local suite: 38 scenarios over both shipped artifacts (lib/index.js and the derived dynamic-package body) against real cordis/dsh-subagent/dsh-session dispatch — node --test test/watchdog.test.mjs.
  • Final packaged re-validation directly observed a real native continuable child end with explicit max-tokens, the same durable child session id start a new activation under a fresh runId 68 ms after settlement, exactly one durable subagent-watchdog/relay marker remain present across later inspection, and the recovered activation complete normally with no watchdog failure notice.
  • The checkpoint-before-followup ordering and genuine AbortSignal plumbing are supported by prior instrumented live probes plus the deterministic suite; they were not independently emitted as explicit records in the final packaged trace.

The full verified seam survey and evidence log lives in docs/DSH-SEAMS.md. The final acceptance phase crossed its original one-run/STOP boundary during debugging; that protocol deviation and the resulting evidence calibration are recorded in docs/PROTOCOL-DEVIATION-2026-08-23.md.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-subagent-watchdog」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:quaner1234-cmd/dsh-subagent-watchdog

Headless(CLI)profile:

dsh plugin --profile headless add github:quaner1234-cmd/dsh-subagent-watchdog

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-26
备注:验证: runtime-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7789 个插件 →