Introduction¶
When running coordinating agents in DeepSeek Harness (dsh), a common pattern is handing tasks over to external sandboxes, remote hosts, containers, or long-running scripts in the current turn, waiting for the other party to finish before resuming. The coordinator cannot keep the WebSocket open indefinitely, nor is it suitable to rely on polling to guess the result. Without a channel to “actively notify the current session once the other party is done,” the agent either sleeps unnecessarily or constantly checks status, compromising both user experience and reliability.
dsh-tmp-hook targets this asynchronous completion scenario: an agent within the session calls a tool to obtain a single-use, TTL-based HTTPS callback URL. External workers use POST to deliver the result once, and the payload is written into the original session as a user message, waking the agent up. A second POST to the same URL returns 410. The following sections describe the plugin’s positioning, installation, configuration, and HTTP conventions.
What is this¶
- Name:
dsh-tmp-hook(npm package name matches the repository name) - Maintainer: Arcadia822 (GitHub:
Arcadia822/dsh-tmp-hook) - Category: Networking Tool (classified in the community directory SkillHub)
- Version (package.json):
0.1.0, MIT License - Summary: Provides a one-time temporary webhook for dsh sessions—mints a single-use callback URL, and external POST payloads wake up the agent session that initiated the request.
The general relationship between the coordinator and the worker is as follows (consistent with the README diagram):
coordinator ──request_tmp_hook──▶ https://dsh.example.com/api/tmp-hooks/<token>
│
│ (Hand over URL to sandbox / remote worker)
▼
worker ──POST result JSON──▶ dsh-tmp-hook ──sessionController.prompt()──▶ coordinator wakes up
Core Features¶
Agent Tool request_tmp_hook¶
When to use (Model-side guidance): Before handing work over to something that finishes after the current turn and cannot be awaited within the current turn—such as sandbox workers, containers, AgentOS tasks, CI jobs, long scripts, dispatched sub-agents, or out-of-band human replies. Not applicable for work that can be completed within the current turn, results that require polling anyway, or cases where the worker already has a dedicated channel.
Optional parameters:
purpose: A brief description of what is being waited for; this is echoed in the callback message to help distinguish between multiple pending callbacks in the same session.ttl_seconds: Time to live, clamped within the configured[minTtlSeconds, maxTtlSeconds].
Return fields include url, token, session_id, expires_at, and expires_in_seconds. The primary value to pass to external workers is url.
HTTP Callback¶
- Endpoint:
POST <baseUrl><pathPrefix>/<token>, body is optional and can be of any type. - Successful Delivery:
200,{"received":true}. This response only indicates the message has entered the session inbox, not that the model has completed a turn. - Error Codes: Unknown token:
404; TTL expired or already used:410; Non-POST method:405; Body exceedsmaxBodyBytes(default 262144):413; Body read failure:400; Session write failure:502. - Token Release: Failures occurring before the message is successfully written to the session (e.g.,
400,413,502) will release the token. This prevents oversized payloads or transient host errors from burning the single notification chance; the token is only consumed upon successful delivery.
Payload Display Rules: Empty body shows (empty); valid JSON is pretty-printed (bare JSON strings like "done" appear as done); other content is shown as-is; Content-Type is included in the message. Display is capped at approximately 64 KiB to avoid bloating the context window.
Authentication & Capability URLs¶
The callback URL itself is a capability: the token is a random UUID, and the worker only needs to know the URL. When allowUnauthenticated: true (default), if dsh-auth-gate is installed, the plugin allows exceptions for its own path prefix on the gate, while the rest of the site remains protected by the gate; if no auth plugin is installed, this composition layer is skipped. If set to false, the entire site remains behind authentication, and the callback prefix requires separate ingress handling (e.g., an nginx location pointing to the dsh port).
Installation & Enablement¶
In the DSH ecosystem, plugins are registered via profiles and bundles; this package declares dsh.bundle.patch, and dsh plugin add coordinates with dsh.profile.bundles.
Install from the registry under the web profile (command from the README):
dsh plugin --profile web add dsh-tmp-hook
For local checkout testing (without going through the registry):
dsh plugin --profile web add /path/to/dsh-tmp-hook
Configuration is written in the profile’s own patch layer ($DSH_HOME/profiles/<name>/cordis.patch.yml), taking effect after the bundle layer. Example:
- id: tmp-hook
config:
baseUrl: https://dsh.example.com # Optional: override the auto-derived public origin
baseUrl is the public origin that external workers actually access. In most cases, this can be omitted: if the console is behind a reverse proxy and has declared a public domain using --trusted-host <domain>, the plugin derives the origin from that declaration. Explicit configuration is only needed when bound to an IP/loopback only or when the scheme needs overriding. If neither baseUrl nor derivation is possible, request_tmp_hook fails explicitly rather than providing an unreachable URL.
Configuration (Excerpts)¶
| key | default | description |
|---|---|---|
baseUrl |
'' |
Callback URL prefix; if empty, derived from trust fence |
baseUrlScheme |
'https' |
Scheme used when deriving origin; ignored if baseUrl is set |
pathPrefix |
'/api/tmp-hooks' |
Route prefix, must be a subpath |
ttlSeconds |
1800 |
Default TTL when the tool does not pass ttl_seconds |
minTtlSeconds |
30 |
Lower bound for requested TTL |
maxTtlSeconds |
86400 |
Upper bound for requested TTL |
maxBodyBytes |
262144 |
Max body size, exceeding returns 413 |
sweepIntervalMs |
60000 |
Expired token sweep interval; 0 disables background sweeping |
deliverTimeoutMs |
15000 |
Time budget for writing to the session |
allowUnauthenticated |
true |
Callback path bypass policy when combined with dsh-auth-gate |
Unknown keys or illegal values are rejected at load time; bad configuration causes startup failure rather than errors on the first callback.
Runtime Environment (package.json): Node ^22.19.0 || >=24.0.0, peer dependency @deepseek-ai/cordis ^4.0.1.
Typical Usage¶
- The coordinating agent calls
request_tmp_hookbefore dispatching work, filling inpurpose(and adjustingttl_secondsif necessary). - Write the returned
urlinto the task instructions for the worker (do not treat additional fields liketokenas mandatory dependencies). - Once the worker finishes, it sends a single
POSTto theurl; the body can be JSON, plain text, build logs, etc. - The session receives a user message similar to the one below, and the agent continues processing:
[dsh-tmp-hook] One-time callback received at 2026-09-18T11:02:21.513Z.
Token: 523a6527-77f0-44c2-b2fc-db7b9cf36a6a
Purpose: e2e-verify
Content-Type: application/json
Payload:
{
"status": "done",
"spec_url": "https://taco.example/spec/42"
}
- If the worker accidentally POSTs twice, the second attempt receives
410(token already used).
Use Cases & Notes¶
Suitable for: Developers needing to orchestrate “external async completion → single wake-up of original session” within dsh; combinable with sandboxes, remote execution, CI, long tasks, out-of-band replies, etc.
Notes:
- The plugin runs with the permissions of the current dsh process; please review the GitHub Source Code and MIT license before installation to ensure compliance with your deployment and security requirements.
- The callback URL acts as a credential; it should be passed to trusted workers via the task channel. TTL and body limits are constrained by configuration.
- Public network reachability depends on your
baseUrl/--trusted-host/ reverse proxy and TLS; the README states that rate limiting, TLS, DNS, and proxying are deployment-side responsibilities (documentation was truncated at the capture point, details are subject to the repository README). - The community directory SkillHub Plugin Page and GitHub are community-maintained and have no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-tmp-hook bridges the gap between coordinating agents and external workers using “one-time HTTPS webhooks + in-session user messages,” avoiding persistent connections or blind polling. Install via dsh plugin --profile web add dsh-tmp-hook and configure tmp-hook in the profile’s cordis.patch.yml as needed.
- Directory Page: https://www.skillhub.cn/plugins/Arcadia822/dsh-tmp-hook
- Repository: https://github.com/Arcadia822/dsh-tmp-hook