Preface¶
In DSH, after a model asks a question via ask_user_question, the session often remains hanging waiting for an answer. If you are in a meeting or temporarily away but the frontend remains open, the next() on the chain will not terminate—it is not uncommon to realize later that you have waited in vain for an hour or two. It is difficult to detect this promptly just by watching the DSH interface.
The community plugin dsh-ask-timeout-notify (maintainer SJTUMalPan) addresses this: under the premise that “the human hasn’t replied yet and the Q&A is still waiting,” if the configurable threshold (default 60 minutes) is exceeded without an answer, it sends a message with need_ack to notify-hub. This creates a to-do and pushes it via channels such as Feishu, webhook, or email. It does not answer on behalf of the user, nor does it change the semantics of DSH “waiting indefinitely.”
What is this¶
dsh-ask-timeout-notify is a workflow-type plugin on the DSH host side (independent GitHub repository, version 0.1.0, MIT License). It starts a timer at the head of the user-questions/request waterfall chain; when the time is up, it calls notify-hub’s POST /api/v1/messages, and notify-hub generates to-dos and pushes them according to existing rules. The plugin itself does not modify notify-hub code, nor does it require separate rules to be added for it—the caller simply declares need_ack: true, and the to-do is handled by the classifier on the notify-hub side.
Core Features¶
What it does and does not do¶
| Does | Does Not |
|---|---|
Starts a timer at the head of the question chain, sends a to-do to notify-hub when time is up (with dedup_key for deduplication) |
Does not answer on behalf of the user, does not change DSH’s semantics of waiting |
| Destroys the timer if the user answers, the request is cancelled, or an error occurs | Does not modify notify-hub source code |
| Logs delivery failures only, does not affect the main Q&A flow | Does not interrupt the waiting Q&A due to notification failure |
When it triggers¶
The maintainer has tested the following behaviors in a real DSH process (stated in the README, not speculation):
| Scenario | This Plugin |
|---|---|
| Frontend is open, answer is not clicked | Delivers to-do when threshold is reached |
Frontend closed / no responder, chain immediately rejects with NO_PROVIDER |
Destroys timer in finally, does not send to-do |
| Answered within threshold | Destroys timer, does not send |
| Session cancelled or processing interrupted | Destroys timer, does not send |
Conclusion: It manages “the human hasn’t replied yet,” not “the human is not present.” If the browser is closed causing no one to take over, the Q&A fails immediately, and this plugin will not send to-dos on this path; its value lies mainly in the period when the frontend is still open and the session is genuinely hanging and waiting for you.
Collaboration with notify-hub¶
notify-hub accepts need_ack: true and dedup_key: repeated timeouts for the same question will not generate multiple unfinished to-dos (the server reuses based on (source, dedup_key)). This plugin acts as a regular message producer, using the same entry point as CI scripts and monitoring alarms.
Prerequisites¶
- DSH is installed and can run
dsh web(with the profile namedweb). - notify-hub is running, and the address and access token are known:
- Example default address:http://127.0.0.1:8000;
- Token:server.auth_tokenin notify-hub’sconfig.yaml; if no token is configured, the service does not authenticate, but the plugin still needs to be configured with a non-empty token value (any non-empty value works, see configuration instructions below).
Installation and Activation¶
The plugin is an independent repository, and the repository root is the plugin package. It can be installed via the DSH plugin market command. After installation, dsh web must be restarted, as changes to the profile’s plugin bundle only take effect for new processes.
Install from GitHub (follow the latest main):
dsh plugin --profile web add github:SJTUMalPan/dsh-ask-timeout-notify
Lock commit (reproducible):
dsh plugin --profile web add "git+https://github.com/SJTUMalPan/dsh-ask-timeout-notify#<sha>"
Local development (execute in the repository root directory, symlink, takes effect immediately after changes):
dsh plugin --profile web add "link:$PWD"
dsh plugin add will bundle the package into ~/.dsh/profiles/web/ and write the package name to the dsh.profile.bundles of that profile’s package.json. Generally, it is not necessary to manually modify profile files.
Uninstallation:
dsh plugin --profile web remove dsh-ask-timeout-notify
Configuration¶
Environment variables take precedence over keys in cordis.patch.yml (environment variables are commonly used to express machine differences in multi-machine deployments). Environment variables should be set along with the dsh web startup method (e.g., export in the startup script) and should not be written into the code repository.
| Environment Variable | cordis.patch.yml Key |
Default | Description |
|---|---|---|---|
DSH_ASK_TIMEOUT_MINUTES |
timeoutMinutes |
60 |
How many minutes of no answer counts as timeout (positive integer, 1–10080) |
DSH_NOTIFY_HUB_ENDPOINT |
endpoint |
None (Required) | notify-hub address |
DSH_NOTIFY_HUB_TOKEN |
token |
None (Required) | Access token, query string ?token=…, not written to logs |
DSH_ASK_NOTIFY_ENABLED |
enabled |
true |
Can be turned off entirely with false |
DSH_ASK_NOTIFY_REQUEST_TIMEOUT_MS |
requestTimeoutMs |
5000 |
Timeout for a single HTTP delivery (milliseconds) |
| — | source |
dsh |
Message source identifier for notify-hub rule matching |
Override configurations should be modified in the profile’s own ~/.dsh/profiles/web/cordis.patch.yml, not in the package’s node_modules/dsh-ask-timeout-notify/cordis.patch.yml. Example:
# ~/.dsh/profiles/web/cordis.patch.yml
- id: ask-timeout-notify
config:
timeoutMinutes: 15
Typical Usage and Verification¶
There is no need for an additional API in daily use: after the model normally calls ask_user_question, if you do not answer within the threshold and the frontend is still taken over by the responder, the to-do will be delivered automatically when the time is up.
Quick verification: Set DSH_ASK_TIMEOUT_MINUTES to 1, restart dsh web, let the model ask a question and then do not answer. After about one minute, you should see a to-do on the notify-hub side; change it back to 60 after verification.
Judging whether it is working:
- No endpoint or token configured: The plugin is still loaded, but there will be a warning in the startup log, and no to-do will be generated after timeout.
- Delivery successful: The DSH log may show
ask-timeout-notify: 已投递待办 message_id=… todo_id=… dedup=ask:<session>:<question id>(whether it appears in stdout depends on the profile log configuration). - More reliable evidence: A to-do with
source=dshappears on the notify-hub/todospage.
For troubleshooting, you can use the unauthenticated health check first:
curl -sS "$ENDPOINT/healthz"
Common phenomena: No to-do and no “delivered” log usually means endpoint or token is not configured; 401 usually means the token does not match notify-hub server.auth_token; “Has apply but never triggers” requires confirming whether the model actually called ask_user_question.
Applicable Scenarios and Notes¶
Who it suits: Local or team environments already running DSH Web and notify-hub, hoping to receive a “DSH is waiting for your answer” to-do via channels like Feishu when the model asks a question and no operation occurs for a long time, rather than discovering the session is hanging empty after the fact.
Permissions and Security: The plugin runs with the current dsh web process and initiates HTTP requests to notify-hub; please review the repository source code and MIT License yourself before installation, and configure tokens according to the environment to avoid committing DSH_NOTIFY_HUB_TOKEN to version control.
Ecosystem Note: The DSH community plugin directory (such as the entry on SkillHub) is an independent site and has no official affiliation with DeepSeek or Huanfang; installation commands and behavior are subject to the GitHub README.
Conclusion¶
dsh-ask-timeout-notify adds a layer of timeout reminders on the path where “Q&A is still waiting, just the human hasn’t replied yet.” It unifies to-dos and multi-channel pushes via notify-hub, and notification failures do not affect the DSH main flow. To further understand installation details, trigger boundaries, and troubleshooting tables, you can directly read the official documentation:
- Directory Page: https://www.skillhub.cn/plugins/SJTUMalPan/dsh-ask-timeout-notify
- GitHub: https://github.com/SJTUMalPan/dsh-ask-timeout-notify