Q1hangL/dsh-ask-guard
Timeout guard for ask_user_question in DeepSeek Harness: a lost or unanswered question resolves as ASK_TIMEOUT instead of hanging the turn forever
已收录
2
Tools
Bundle 已验证
预览
功能介绍
为 ask_user_question 提供协作式超时守卫:提问卡片丢失或用户未答复时以结构化 ASK_TIMEOUT 结束调用,避免回合无限挂起。
适合
- 会因后台标签页、设备休眠或 WebSocket 断连而丢失 `ask_user_question` 卡片的 DSH Web 用户。
- 用户可能一直不回答问题、但仍需可预测恢复的长时间 Agent 工作流。
- 希望配置提问截止时间,并以结构化 `ASK_TIMEOUT` 让回合正常结束的运维者。
不适合
- 从不调用 `ask_user_question` 的工作流;其他工具不会因该插件发生变化。
- 确实需要超过当前截止时间才能回答的问题,除非相应调高 `timeoutMs`。
- 提问提供方不响应协作式执行中止信号的环境。
README
dsh-ask-guard
Timeout guard for ask_user_question in DeepSeek Harness: a lost or
unanswered question resolves as a structured ASK_TIMEOUT instead of hanging
the turn forever.
The problem
The question card is delivered to the browser over a single push on the mux WebSocket. When the page is backgrounded, the laptop sleeps, or the connection dies half-open, the frame is lost, the client never notices (no heartbeat), and the tool waits forever — observed hangs of 6+ hours, recoverable only by pressing Stop. Upstream report: deepseek-ai/deepseek-harness#1554.
What this plugin does
It registers a tools/execute wrapper that arms a cooperative deadline on
every ask_user_question dispatch (the same mechanism as the official
dsh-tool-call-timeout-policy, which only enforces budgets declared by tool
plugins — ask_user_question declares none).
- When the deadline wins, the waiting provider’s abort handler fires: the web
provider broadcasts
question/resolved cancelled, so the stuck composer (if any) is cleaned up. - The wrapper then replaces the normalized abort with a structured error result
(
code: ASK_TIMEOUT,name: AskTimeoutError) with a model-facing message, so the agent can end the turn gracefully instead of blocking. - All other tools pass through untouched.
The timeout is cooperative (@deepseek-ai/dsh-timeout notifies via
exec.signal; the web user-questions provider honors the signal, so it
terminates for real).
Install
dsh plugin --profile web add dsh-ask-guard
Restart dsh web. The plugin is a dsh.bundle package, so its patch row is
added to the profile composition automatically on reconcile.
Install from a git checkout instead:
dsh plugin --profile web add github:Q1hangL/dsh-ask-guard
Config
| Field | Default | Meaning |
|---|---|---|
timeoutMs |
300000 |
Deadline for one ask_user_question call (ms). |
Tune it in the profile’s cordis.patch.yml:
- id: ask-guard
config:
timeoutMs: 600000
Recovery note
A page refresh (F5) re-syncs pending questions — the host replays unanswered questions to a reconnecting client. With this plugin, even without a refresh the turn no longer hangs forever.
Test
npm install
node --test
License
MIT
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:Q1hangL/dsh-ask-guard。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。