You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Desktop TUI: ask_user_question never renders — api-remotes claims user-questions/request for the remote surface (which has no answerer) and the real error is masked as ASK_ABORTED
#11721
On a desktop dsh-tui host the ask_user_question questionnaire never renders. The tool
call hangs, the user sees only a spinner, and after 8–20 s it fails with:
Error: ask_user_question was aborted before the user answered (code: ASK_ABORTED)
Impact: every model-side question in a TUI-only deployment is unusable. The failure is
silent from the model's perspective (it looks like the user refused to answer) and the
surfaced error names the wrong party, which made this take many rounds to localise.
Environment
@deepseek-ai/dsh
0.2.1-rc.3
@deepseek-harness-tui/dsh-tui
0.17.0 (current latest)
@deepseek-ai/dsh-user-questions
0.2.1-rc.3
OS / terminal
Windows 11, Windows Terminal
Profile plugins
35 bundles; not caused by any third-party plugin (verified by removal, see below)
Reproduces on a freshly restarted host process (11:46:57 boot) — not stale session state.
Root cause
1. user-questions/request is claimed by the remote forwarder unconditionally
@deepseek-ai/dsh-api-remotes hardcodes it into the forwarded-event list:
The runtime copy is inlined into the bundle (lib/index.js:5 → //#region lib/types/remote-events.js, array at lib/index.js:21, entry at lib/index.js:133–137) and
consumed by:
// lib/index.js:162–171 — claims the event whenever it is bound to an agentconstcarrierAgent=carrierKeyOf(this);if(carrierAgent===void0)returnnext();…returnforwardWaterfall(queue,event,request,{value: agent.ctx,subject: agent,agentId: agent.id},next);
There is no capability check: it never asks whether any connected peer can render or
answer a questionnaire. In a desktop-TUI composition there is no such peer — the only
answer UI in the codebase is the web client:
Because the forwarder claimed the event, the TUI's own answerer never sees it, so AskUserQuestionPanel is never mounted (the panel itself is fine — it renders correctly
once the request reaches the store).
// dsh-tui lib/types/dsh-adapter/questions-answerer.js:39–42 — the listener that never fireskind: 'waterfall',register: owner=>events.on('user-questions/request',(request,next)=>{…returnnext();
2. The gateway then cancels the forwarded request
After 8–20 s the request's AbortSignal is aborted and the pending remote event is rejected:
and abortedQuestion() (lib/index.js:435–437) builds:
newUserQuestionError("ask_user_question was aborted before the user answered","ASK_ABORTED",{ cause })
cause is never surfaced to logs. This is the reason the bug is near-undiagnosable from the
outside: the message blames the user, while the actual failure is "the gateway forwarded the
request to a surface with no answerer and then cancelled it".
How I proved it (temporary instrumentation, since removed)
I patched dsh-user-questions/lib/index.js with three appendFileSync log points
(entry / noAnswerer / catch-with-stack) and re-ran. The log shows the request entering the
service and then dying at the gateway:
04:07:27.883Z ASK-in agentId=3871cf73-… idType=string nq=1 fields=["questions","agent","signal"]
q0keys=["id","question","header","options","multiSelect"] opt0={"description":"…","label":"A:…"}
04:07:35.845Z CATCH name=Error code=undefined msg=typert gateway: Remote event was cancelled aborted=true
stack=Error: typert gateway: Remote event was cancelled
at AbortSignal.abort (…/dsh-api-gateway/lib/index.js:1084:72)
The TUI's QuestionStore never received the request at all (no snapshot, no panel), and the
CATCH stack proves the rejection originated in the gateway, not in the local answer path —
i.e. something upstream of the TUI's user-questions/request listener settled the promise.
(The instrumentation was removed after diagnosis; the log file was not kept.)
Ruled out experimentally:
Phone / remote plugin — attested: with the phone app closed (remote_conns: 7 → 4 in
the remote log) it still aborted; uninstalling ds-harness-remote from dsh.profile.bundles and restarting still aborted (04:12:09 → 04:12:26, 17 s).
The forwarding layer is core, not plugin-provided.
Version mismatch — dsh-tui@0.17.0 peer whitelist explicitly lists 0.2.1-rc.3; only
one copy of dsh-user-questions exists on the machine.
Question length / shape — a 16-character question with 3 options aborts identically.
(options must be objects {label, description?}; string options fail earlier with "questions[0].options[0]" must be an object — see the note at the end.)
Provider seat conflict — no plugin registers a question provider; grep over all 35
bundles finds only consumers (@michengai/dsh-code-review calls ctx.userQuestions.ask(...)) and RPC whitelist strings in ds-harness-remote.
Reproduction
Start a desktop dsh-tui host with no web client attached.
Call ask_user_question with any question (1 question, 3 options).
Observe: no panel at all (nothing appears in the composer slot), only the spinner.
After 8–20 s the tool returns ASK_ABORTED.
Press Esc → ASK_CANCELLED (i.e. #4 happens without user interaction).
Expected
Either the local TUI questionnaire renders, or the request fails immediately with an error
that names the real cause.
Suggested fixes (any one helps)
Capability-gated forwarding. Only claim user-questions/request when at least one
connected peer has registered a handler for it; otherwise next().
Local UI wins. If the composition has a mounted QuestionStore
(getQuestionStore(ctx) !== undefined, see dsh-tui/lib/types/dsh-adapter/questions.js),
do not forward user-questions/request at all.
Make the forwarded-event list configurable so a TUI-only / headless profile can opt out
without patching a package under node_modules.
Stop masking the cause. When rethrowing abortedQuestion(error), at minimum log error.message/stack (or attach them so they survive into the tool result).
plus a host restart → the questionnaire renders immediately and works normally
(selection, multi-select, Tab custom text, ←/→ between questions all verified). approval/request was left untouched and still forwards. Re-installing ds-harness-remote
and restarting keeps it working, so the regression is specific to question forwarding.
Caveats, stated honestly:
lib/types/remote-events.js:44 still contains the entry (that file is not reachable through
the package exports map, which points . at lib/index.js), so the two copies can drift;
patching both would be safer.
This worked once before in the same build (2026-10-29, a question was answered
successfully in this profile). So I cannot claim "always broken since version X" — something
about the remote/gateway state changed afterwards. I have no bisect for that, and I did not
keep the earlier logs beyond the tool result.
Minor, unrelated
ask_user_question rejects string options with Error: invalid arguments: "questions[0].options[0]" must be an object. Fine as a contract,
but the tool description could say so — it costs a round-trip to discover.
Update: approval/request has the exact same root cause (verified on the same machine)
After patching only user-questions/request, I tested the approval path on the same host and found it broken in exactly the same way. API_REMOTE_FORWARDED_EVENTS contains twowaterfall entries, not one:
The other 26 entries are one-way emit and are unaffected.
The symptom differs, the cause does not
With the approval policy at ask (/permission workspace-write), a tool that needs approval fails with:
Error: tool call aborted before dispatch
No approval bar is ever drawn, and the tool is not even dispatched. The same AbortSignal cancellation is happening; there is just no UserQuestionError wrapper to mask it, so the message looks different from ASK_ABORTED.
Note for other reproducers: under the default danger-full-access preset the approval policy is never, and dsh-user-approval short-circuits to rejected — so this half of the bug is invisible until you switch to workspace-write.
Plan review is on the same path
exit_plan_mode has no channel of its own: dsh-plan-mode/lib/index.js sends the plan through the question service as questions with intent.kind = "plan-review". It therefore fails and recovers together with ask_user_question.
Confirmed behaviour after removing both entries
questions / plan review: panel renders, answers arrive normally
approval: bar appears, the tool proceeds after Allow
still forwarded: (none) — mode: "waterfall" no longer appears anywhere in the list
re-enabling the ds-harness-remote plugin does not reintroduce the bug (this is core api-remotes / api-gateway, not the remote plugin)
So the suggested fixes in the original report should be read as covering both events: (1) only forward to peers that can actually answer, or skip forwarding entirely when a local answerer exists (QuestionStore / ApprovalStore); and (2) never mask a non-UserQuestionError into ASK_ABORTED when the signal is aborted.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
On a desktop
dsh-tuihost theask_user_questionquestionnaire never renders. The toolcall hangs, the user sees only a spinner, and after 8–20 s it fails with:
Impact: every model-side question in a TUI-only deployment is unusable. The failure is
silent from the model's perspective (it looks like the user refused to answer) and the
surfaced error names the wrong party, which made this take many rounds to localise.
Environment
@deepseek-ai/dsh@deepseek-harness-tui/dsh-tui@deepseek-ai/dsh-user-questionsReproduces on a freshly restarted host process (11:46:57 boot) — not stale session state.
Root cause
1.
user-questions/requestis claimed by the remote forwarder unconditionally@deepseek-ai/dsh-api-remoteshardcodes it into the forwarded-event list:The runtime copy is inlined into the bundle (
lib/index.js:5→//#region lib/types/remote-events.js, array atlib/index.js:21, entry atlib/index.js:133–137) andconsumed by:
There is no capability check: it never asks whether any connected peer can render or
answer a questionnaire. In a desktop-TUI composition there is no such peer — the only
answer UI in the codebase is the web client:
Because the forwarder claimed the event, the TUI's own answerer never sees it, so
AskUserQuestionPanelis never mounted (the panel itself is fine — it renders correctlyonce the request reaches the store).
2. The gateway then cancels the forwarded request
After 8–20 s the request's
AbortSignalis aborted and the pending remote event is rejected:3.
dsh-user-questionsdiscards the real errorand
abortedQuestion()(lib/index.js:435–437) builds:causeis never surfaced to logs. This is the reason the bug is near-undiagnosable from theoutside: the message blames the user, while the actual failure is "the gateway forwarded the
request to a surface with no answerer and then cancelled it".
How I proved it (temporary instrumentation, since removed)
I patched
dsh-user-questions/lib/index.jswith threeappendFileSynclog points(entry /
noAnswerer/ catch-with-stack) and re-ran. The log shows the request entering theservice and then dying at the gateway:
The TUI's
QuestionStorenever received the request at all (no snapshot, no panel), and theCATCH stack proves the rejection originated in the gateway, not in the local answer path —
i.e. something upstream of the TUI's
user-questions/requestlistener settled the promise.(The instrumentation was removed after diagnosis; the log file was not kept.)
Ruled out experimentally:
remote_conns: 7 → 4inthe remote log) it still aborted; uninstalling
ds-harness-remotefromdsh.profile.bundlesand restarting still aborted (04:12:09 → 04:12:26, 17 s).The forwarding layer is core, not plugin-provided.
dsh-tui@0.17.0peer whitelist explicitly lists0.2.1-rc.3; onlyone copy of
dsh-user-questionsexists on the machine.(
optionsmust be objects{label, description?}; string options fail earlier with"questions[0].options[0]" must be an object— see the note at the end.)bundles finds only consumers (
@michengai/dsh-code-reviewcallsctx.userQuestions.ask(...)) and RPC whitelist strings inds-harness-remote.Reproduction
dsh-tuihost with no web client attached.ask_user_questionwith any question (1 question, 3 options).ASK_ABORTED.ASK_CANCELLED(i.e. #4 happens without user interaction).Expected
Either the local TUI questionnaire renders, or the request fails immediately with an error
that names the real cause.
Suggested fixes (any one helps)
user-questions/requestwhen at least oneconnected peer has registered a handler for it; otherwise
next().QuestionStore(
getQuestionStore(ctx) !== undefined, seedsh-tui/lib/types/dsh-adapter/questions.js),do not forward
user-questions/requestat all.without patching a package under
node_modules.abortedQuestion(error), at minimum logerror.message/stack(or attach them so they survive into the tool result).user-questionswaterfall) and Approval is unreachable from a UI-initiated Remote call: no open turn, no agent #11178: waterfall queue semantics let one surfacestarve or swallow a request that another surface could have answered.
Minimal local patch (verified working, 2026-11-01)
Removing the single entry from the forwarded-event list in
@deepseek-ai/dsh-api-remotes/lib/index.js(i.e. lines 133–137 of the bundle):plus a host restart → the questionnaire renders immediately and works normally
(selection, multi-select,
Tabcustom text,←/→between questions all verified).approval/requestwas left untouched and still forwards. Re-installingds-harness-remoteand restarting keeps it working, so the regression is specific to question forwarding.
Caveats, stated honestly:
lib/types/remote-events.js:44still contains the entry (that file is not reachable throughthe package
exportsmap, which points.atlib/index.js), so the two copies can drift;patching both would be safer.
successfully in this profile). So I cannot claim "always broken since version X" — something
about the remote/gateway state changed afterwards. I have no bisect for that, and I did not
keep the earlier logs beyond the tool result.
Minor, unrelated
ask_user_questionrejects string options withError: invalid arguments: "questions[0].options[0]" must be an object. Fine as a contract,but the tool description could say so — it costs a round-trip to discover.
All reactions