Introduction¶
In DeepSeek Harness (DSH), scheduled schedule and common wake-up plugins mostly run timers or probes inside the host process. Once the host exits, probing and delivery stop together, making it hard to recover changes that appeared and then disappeared during that time. If your automation relies on signals “happening outside the host pipeline” such as CI completion, build artifact landing, or external service state flips, you need a wake-up channel that doesn’t tie its lifeline to the host. dsh-wake-relay (maintainer: tendayst, category: workflow) does this: it keeps the judgment logic in an external process and delivers via HTTP into the host; it agrees that 200 means flushed, 503 means nothing was recorded, allowing the caller to retry with the same event_id, and events during host downtime can wait in the external queue until the host returns.
What is This¶
One sentence: any external process that can send an HTTP POST to 127.0.0.1 can synchronously wake up a DSH session — suitable for build monitoring, task cleanup, CI callbacks, scraping completion, mobile push forwarding, and custom-written watchers.
The division of labor with “how to wake up a sleeping agent” type plugins can be understood this way: those plugins focus on wake-up logic inside the host; this plugin focuses on “what to do if the line that wakes it up breaks” — probes sample normally from outside, events stay in your queue when the host is offline, and are resent with the same event_id when it comes back online.
- Plugin Name:
dsh-wake-relay - Current Version (package.json): 0.1.3
- License: MIT
- Repository: GitHub — tendayst/dsh-wake-relay
- Community Directory: SkillHub Plugin Page
DSH ecosystem advocates “everything is a plugin”; community sites like SkillHub are independent community sites and have no official affiliation with DeepSeek / 幻方.
Core Mechanism¶
The data flow can be summarized as:
External Process (script / built-in watcher)
└─ Condition met → POST 127.0.0.1/wake ──┐
│ Host online: Injected and flushed immediately
│ Host offline: Connection failed, events stay in queue
└→ Host returns: Resent with same event_id
HTTP semantics are a hard contract:
| Status | Meaning | Caller |
|---|---|---|
| 200 | Delivered and flushed | Done |
| 429 (duplicate / cooldown / burst) | Dropped per policy | Do not retry |
| 503 (delivery_failed, etc.) | Nothing recorded | Retry with same event_id |
| 401 / 400 | Token or format error | Fix caller |
Compared to host-side probes (e.g., dsh-sentinel): this plugin has no dock sidebar UI, targets scripts; on port conflict with multiple instances, it falls back to a random port; on Windows, process probes can use the native OpenProcess. See the repository README for the full comparison table.
Installation and Enablement¶
Desktop profiles cannot be installed via command line. desktop is exclusively managed by Electron; running the following command will result in a direct error:
error: profile "desktop" is managed exclusively by the Electron application
There are two paths below.
Let DSH Install Itself (Desktop/Web versions work, recommended in README)¶
Hand over the instructions from the README’s “Installation” section to the current DSH session, and let it install according to the document steps. The criterion is: a new listening line appearing in $DSH_HOME/wake-bridge.log; simply install_bundle returning applied does not count as a successful load.
Command Line (dsh web and other Electron-unmanaged profiles)¶
dsh plugin --profile web add dsh-wake-relay
Installing from local directory (commands from README):
git clone https://github.com/tendayst/dsh-wake-relay
dsh plugin --profile web add ./dsh-wake-relay
Installation usually takes effect immediately; if there is no listening line, restart DSH once.
Note: Do not install a second wake-up plugin simultaneously. The implementations will all write to $DSH_HOME/wake-endpoint.json, causing port conflicts, and stopping might make the peer discover the file as invalid. The bundle’s entry id must be globally unique; if there is already a patch with the same id in cordis.patch.yml and disabled: true, it might silently swallow the other patch — rely on the endpoint file in wake-endpoint.json, wake-bridge.log, and wake-bridge-secret.json as the standard.
Leaving sessionId empty is legal, but you cannot test wake directly without a session field, otherwise you will get 503 no_session_bound; you need to hardcode sessionId in the configuration or carry session with every request.
This plugin runs under the current DSH process permissions; please read the source code and MIT license before installing to evaluate whether to include it in your workflow.
Configuration Key Points¶
Written in cordis.patch.yml in the profile (or config of the bundle) or inside the package. Common fields (defaults refer to README):
| Field | Default | Description |
|---|---|---|
port |
45871 | Bound only to 127.0.0.1; if occupied, falls back to random port and rewrites endpoint file |
token |
Empty | If empty, written to $DSH_HOME/wake-bridge-secret.json (0600) on first start |
sessionId |
Empty | Default target session; if empty, request must carry session |
cooldownMs |
90000 | Minimum interval per reason |
reasonWindowMs / reasonMaxHits |
300000 / 2 | Trigger limit within the same reason window |
globalBurstMs |
3000 | Minimum interval between any two wake-ups |
flushTimeoutMs |
10000 | Timeout back to 503 on delivery |
dedupeWindowMs |
604800000 | event_id deduplication (7 days) |
template / footnote |
Empty | Message template and footer |
watcherStatePath |
Empty | External watcher state, GET /status will fold it |
API and Typical Usage¶
Endpoints (excerpt):
GET /health → Public, no token
GET /status → Requires token
POST /wake → Header `x-wake-token`
POST /bind → Change default session (not persistent, reverts to config on restart)
POST /wake request body example:
{
"event_id": "build-2026-11-12-7f3a",
"kind": "signal",
"reason": "BUILD_DONE",
"detail": "17 个用例通过,0 失败",
"data": { "任何": "结构化字段" },
"session": "session-…(可选)"
}
Script to discover connection info:
EP=$(cat ~/.dsh/wake-endpoint.json)
curl -s -X POST "http://127.0.0.1:$PORT/wake" \
-H "x-wake-token: $TOKEN" -H "content-type: application/json; charset=utf-8" \
--data-binary @event.json
Node.js client (package exports ./client):
import { wake } from "dsh-wake-relay/client";
const r = await wake({ event_id: `job-${Date.now()}`, reason: "JOB_DONE", detail: "…" });
if (r.retryable) setTimeout(() => wake(sameEvent), 30_000);
Chinese body must be UTF-8; pay attention to encoding when sending requests via PowerShell, otherwise detail might become ?.
Optional: Built-in Python Rule Engine¶
The repository watcher/ provides a persistent rule table to reduce the need to “write a polling script for every scenario”:
python watcher/waiter.py --rules watcher/rules.example.json --list
pythonw watcher/waiter.py --rules my-rules.json
Supports probes like file_exists, pid, port, http_json, command, edge triggering, retry queues, and rule hot reloading; state directory defaults to $DSH_HOME/wake-bridge-watcher.
Suitable Scenarios and Boundaries¶
Suitable for: Existing external watchers or CI/webhooks that need to ensure wake-up intentions are not lost during host restarts or upgrades; needing arbitrary command/JSON assertions rather than just fixed sensor types; accepting no UI and using GET /status and logs for operations.
Boundaries (stated in README):
- The host must be online to complete delivery; during offline periods, events are only accumulated in the external queue (constrained by
ttl_s, etc.) and are not pre-written to disk for replay. /bindis not persistent;tokenis written in plaintext towake-endpoint.jsonand only listens locally, do not arbitrarily forward ports.- One wake-up triggers a full inference; for high-frequency conditions, it is better to write a state file than to repeatedly wake up.
session: latestis a heuristic to select the newest session; long tasks should explicitly specifysession.
Self-test: node selftest.mjs, python watcher/selftest.py (see repository).
Conclusion¶
dsh-wake-relay moves the “judgment” part of the wake-up chain outside the host and keeps the “delivery” inside, using 200/503 to clarify retry and idempotent semantics, making it suitable for automation developers who want to hook workflow signals into DSH. For further understanding, please read the SkillHub directory page and the GitHub repository README.