Repository navigation
Releases
dsh-wait-guard v0.1.0
Keep an Agent's turn open until every descendant subagent settles — a pure Host-plane completion gate for DeepSeek Harness.
Install
dsh plugin --profile <your-profile> add github:dn4hjtcr9s-del/dsh-wait-guard#v0.1.0Or in the Web UI: Plugins → Add plugin, and paste whatever follows add above.
The problem it solves
A delegating agent can end its turn before its subagents report. The harness has no native "wait for every child" rule: nothing in the default composition listens on agent/turn-stopping to hold the turn, and the only "must wait for teammates" wording lives in the experimental Agent Teams bundle — a prompt sentence, not enforcement. The model answers with partial results, and the settlement notices arrive afterwards as separate turns.
What it does
The gate hangs off agent/turn-stopping — the serial, awaited event dsh-agent-loop fires immediately before it re-reads the inbox and decides whether to close the turn — and simply does not return while any descendant is still running. Descendants are probed across the whole tree, filtered by the Agent registry's real status, so an idle coordinator with a running grandchild also holds the gate.
Deactivation is exactly two paths, each ending with the plugin completely out of the way:
| Path | Trigger | Behaviour |
|---|---|---|
| a message arrived | settlement notice · child relay · human message | stops waiting and injects nothing; that step belongs entirely to the model |
| the silence timer elapsed | firstWaitMs (default 60 s) of silence within one stop attempt |
injects exactly one reminder, then leaves |
Deactivation is always temporary: the next time the model tries to close the turn, the gate re-engages immediately if descendants remain. The plugin never rewrites the reason a turn ended — it only postpones the decision.
Configuration
One row in cordis.patch.yml; firstWaitMs (60 s), nudge (timer on/off), releaseOn (['*'] = any arrival, or ['user','agent-message'] to batch settlement notices), companionReminder, policySection, onProbeError, and text overrides supporting {n} / {s} / {list}. See the README for the full table.
Verification
npm test→ 22 functional tests + 7 bundle-shape checks pass.- Bundle install verified in an isolated profile (
DSH_HOME=/tmp/...): the composed tree containsid: wait-guard/name: dsh-wait-guard. - Live on a real profile: a deliberately premature answer was held 11–61 seconds until the last subagent settled, with a
turn/endcount of 0 and 0 injected messages. Control run with the plugin unmounted: the turn closed 2 seconds after the same gesture while a child was still running, and that child's notice only arrived as a later turn.
Properties
Import-free (nothing resolves at load time), dependency-free, write-free, no global state; every listener is disposed with the plugin and pending waits resolve on disposal, so uninstalling can never leave a turn stuck. MIT licensed.