条件驱动唤醒:file/command/http/process/webhook 持久监视,触发即唤醒 agent。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:fuhefei/dsh-sentinel
GitHub 来源的插件在安装时会在你的机器上执行构建脚本。请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
Condition-driven wakeup for DeepSeek Harness: the agent registers a watch, goes to sleep — even closes the session — and the sentinel wakes it when the condition happens. Every subscription and every fire is a user-visible session event, and the browser dock shows what is on duty.

How it works
The node half owns one server-lifetime runtime that folds a plugin-owned sidecar log ($DSH_HOME/sentinel.jsonl) into live subscriptions, probes every sensor on a shared 5s heartbeat, and delivers wakeups through the official followup channel — resuming a dormant session's agent first when needed. Subscriptions therefore survive process restarts, and conditions that become true while the server is down late-fire on the next probe.
Watching is a resident-process concern: probing and fire delivery only run while a long-running dsh process (typically dsh web) is up. Headless one-shot runs load the plugin and can create, list and cancel watches, but nothing probes after the process exits — those watches become active once a resident process starts.
One duty owner per $DSH_HOME: a lease file (sentinel.lease) makes the first process own probing and delivery; a second dsh process on the same home stays passive (tools work, writes persist to the shared sidecar) and takes over within one lease TTL of the owner dying. The owner re-reads the sidecar every heartbeat, so watches created on a passive instance are adopted automatically. Delivery is at-least-once: a fire logged but not delivered before a crash is requeued on the next boot from its delivered watermark.
The browser half is a dock card above the composer (the conversation.input.dock family) listing the session's active watches — sensor, target, live probe state, fire budget, next-probe countdown — plus recent fire history when expanded. It polls the read-only state route and renders nothing when the session has no watches.
Two surfaces make the server-global watch set visible. A sidebar branch grows under every session row that has active watches (sidebar.workspaces.sessionRow.branch, one shared poller for all rows) — collapsed it is a 👁 count, expanded it lists the session's watches and links to the dashboard. The dashboard is a standalone table of every watch across every session: session (active/dormant), sensor, target, pattern, fire budget, last probe state, next probe.
| Sidebar branch | Global dashboard |
|---|---|
![]() |
![]() |
Sensors
| Kind | Engine | Fires on |
|---|---|---|
file |
path snapshot + inotify push | snapshot change (sub-second); accelerated by fs events |
command |
read-only shell line, probed on an interval | output/exit-code change |
http |
URL probed on an interval | status/body change |
process |
pgrep -f pattern, probed on an interval |
match-set change |
port |
TCP connect to [host:]port, probed on an interval |
reachability change (open/closed/timeout) |
webhook |
pure push | any POST to the returned hook URL |
With pattern, probe kinds fire on the no-match→match edge of that regex and webhooks accept only matching payloads; without it, probe kinds fire on any change after the baseline.
Configuration
All deployment-tunable knobs live in the plugin's config schema (defaults in parentheses); override them on the bundle row in your profile's cordis.patch.yml:
- id: dsh-sentinel
name: '@dsh-external/dsh-sentinel'
config:
heartbeatMs: 5000 # probe round interval
probeConcurrency: 8 # in-flight probes per round
maxSubscriptionsPerSession: 16
maxPendingWakeups: 8 # queued wakeups per session before dropping oldest
defaultIntervalSeconds: 30 # when a watch does not specify one (5–86400)
defaultCooldownSeconds: 60
dutyLeaseTtlMs: 30000 # passive-instance takeover window after the owner dies
notifyWebhookUrl: '' # optional: POST every fire here as JSON
Invalid values fail plugin load with a schema error rather than misbehaving at runtime.
notifyWebhookUrl fans every fire out of the harness as a JSON POST ({plugin, event, sessionId, id, kind, target, note, fireNumber, maxFires, summary, after}) — point it at a Lark/WeCom/Slack bot or any receiver. Delivery is at-most-once: a failed POST warns in the log and never blocks the in-harness wakeup.
Tools
sentinel_watch— register a watch:kind,target, optionalpattern,interval(1–3600s, default 30),note(delivered verbatim with every wakeup),maxFires(default 1: one-shot),cooldown(default 60s), optionalttl.sentinel_list— active watches with live probe state.sentinel_cancel— cancel one watch by id.
Routes
GET /plugins/dsh-sentinel/state?sessionId=…— read-only state for the dock and the sidebar branch (omitsessionIdfor every session).GET /plugins/dsh-sentinel/dashboard— the server-global watch table.POST /plugins/dsh-sentinel/hook?id=watch-N— webhook entry; put acurlinto a CI job, git hook, or another machine's script to wake the agent.
Install
One line through the official bundle channel (build artifacts are committed, so the git-source install runs no build):
dsh plugin --profile web add "github:fuhefei/dsh-sentinel#v0.7.0"
Alternatively, add the node half manually through a patch-list configuration over the shipped base:
# cordis.patch.yml
- insert:
- id: dsh-sentinel
name: '@dsh-external/dsh-sentinel'
The browser half ships in the same package (./client) and is injected by the Web UI's plugin loader.
Sidebar branch prerequisite
The dock and the dashboard work on a stock host. The sidebar branch needs the session-row extension holes, which the official tree does not declare yet; apply the bundled patch to your DSH source checkout and rebuild ui-workspace:
git apply /path/to/dsh-sentinel/patches/session-row-holes.patch
The patch declares sidebar.workspaces.sessionRow and sidebar.workspaces.sessionRow.branch as list holes (every registrant renders, in order) at root scope (sidebar rows render outside any session binding; the row passes its sessionId through owner props). dsh-subagent-tree ships a patch for the same hole names with different semantics (keyed/session); apply one or the other, not both.
better-sidebar integration (optional)
When dsh-better-sidebar is installed in the same profile, sentinel registers its global watch table as a sidebar tab (dsh-sentinel:watches, in the + menu) through better-sidebar's documented ctx.betterSidebar.registerTab extension surface: every watch server-wide with live probe state, fire budgets and recent fire history, fed by one shared poller. No configuration needed; without better-sidebar the registration is silently skipped and the dock / branch / dashboard keep working as before.

Plays well with
Install dsh-notification alongside sentinel and the whole wakeup loop reaches your desktop: sentinel wakes the agent, the agent works the turn, and the turn's completion fires a desktop notification — no integration needed, the two plugins compose on their own.
Develop
npm install
npm run build # tsc -b + tsdown (lib/index.js, lib/client.js)
npm test # vitest: domain fold/normalize, sensors, dashboard escaping, e2e wakeup flow
License
BSD 3-Clause. See LICENSE.
链接
同类插件
NanmiCoder/dsh-agent-teams★ 230
AgentTeams 多智能体团队。
icetomoyo/dsh_workflow★ 54
把 UltraCode 式多 Agent 调度带给 DSH:可生成、可保存、可治理、可观察、可恢复的 Workflow 层。
btspoony/mstar-harness★ 42
技能驱动的 harness/loop 工程化工作流插件。
titanwings/dsh-automation★ 30
定时任务:让 Coding 任务按计划在全新 Agent Session 中运行,保留可审计历史。
whyihaveyou/dsh-suite#plugin-team-board★ 14
多 agent 共享任务板:经 Cordis service key 创建/认领/流转/查询任务。
omdsh-dev/dsh-deep-research★ 9
自适应深度研究编排器(基于官方 workflow 引擎)。

