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

main기타 소스 보기

설치

npx -y @deepseek-ai/dsh plugin --profile web add github:Q1hangL/dsh-ask-guard

이 설치 명령은 GitHub 저장소 주소에서 생성된 확인되지 않은 시작점입니다.

README

유지 관리자가 작성한 문서 스냅샷입니다.

GitHub에서 보기 ↗
커밋 a45f230동기화 2026. 8. 18.

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

FieldDefaultMeaning
timeoutMs300000Deadline 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

프로젝트 파일 및 신호

표시된 항목은 디렉터리 스냅샷에서 감지된 공개 저장소 신호입니다.

테스트감지됨

저장소 정보

언어
JavaScript
라이선스
MIT
마지막 업데이트
2026. 8. 14. 오후 6:03

신중하게 설치하기

소스 코드, 권한, 수명 주기 스크립트, 의존성 및 네트워크 접근을 검토하고 신뢰하지 않는 플러그인은 격리 환경에서 테스트하세요.