ChatGPTClaudeGrok / X / CursorGemini

DSH plugin user questions: pending state and late replies

Plugin DevelopmentPublished 2026-11-12Author: DeepSeek Plugin Market
DSH pluginDeepSeek HarnessUser questionsTimingLate replies
DSH plugin user questions: presentation intents, four answer encodings, pending versus empty answers, attachWait deadlines, and late reply settlement.

"The user answered late and the tool returned a second result" usually means pending was read as completion. In DSH plugin's user interaction seam, pending explicitly means "still answerable" — not an empty answer and not authorization. Understand that difference and timing plus late replies become readable.

Three shapes and presentation intent

Intent changes display only; answer encoding is identical.(source)

AskUserQuestionOption has label and optional description. label is both the user-facing option text and the model-facing selected value — which is why answers carry label strings rather than indexes.

AskUserQuestionItem contains a stable id (returned verbatim with the answer so batched questions stay routable), question, optional detail (rendered with the question but kept out of option labels), optional header, optional options, optional multiSelect (single-select by default), and optional intent.

questions is an array so a UI can present related prompts in one flow while keeping each answer stably identified. If agent is supplied it must be the same instance as the live caller, and the seam admits it only when the current registry recognizes that instance as the runtime root.

AskUserQuestionIntent has two values:

  • plan-review — names the approve option and requires plan body text; approve is specified by name rather than position and must name one of this question's options or ask() rejects; every other option means not approved.
  • approval — a blocking permission decision with fixed actions and no free text; it requires exactly one blocking question with an explanation plus distinct reject, allow, and optional always-allow labels fully covering the supplied options, with no multi-select and no timed waiting.

approval's subject is human-recognizable metadata and never authorization identity. A UI that does not recognize a tag falls back to the generic option list without affecting answer encoding.

Four answer encodings

In single-select, custom overrides selected; in multi-select, both may coexist.(source)

The provider returns one AskUserQuestionAnswerItem per question id, with id, selected, and optional custom:

  1. single-select with a chosen option — selected holds one label, no custom;
  2. single-select with free text — custom carries the "other" answer and selected is empty;
  3. multi-select with added free text — custom supplements the labels in selected;
  4. a skipped question — the UI may use an answer item with empty selected and no custom to preserve it inside an otherwise complete batch.

Case 4 is often misread as "empty answer." It is not a failure but an explicit preservation, and batch completeness depends on it.

Timed questions and pending

Once the window closes, the agent can keep working independently.(source)

A timed question waits inside a bounded foreground window and then lets the agent continue on its own. If the user answers within the window, the tool returns the full batch; otherwise TimedUserQuestionResult is { pending: true, callId }.

The reference is firm about pending: it means the question is still answerable, not that it is empty, rejected, confirmed, or authorized.

The foreground answerer receives wait: { callId, timed: true }, where callId identifies the card and the foreground wait. A Client calls attachWait to take over the wait and learn the remaining time; the transport only forwards the original event without inspecting or rewriting those fields. A wait without timed is a named card request waiting indefinitely, and no wait at all is a blocking request with no card key.

attachWait and deadline ownership

The deadline lives in the Host and the countdown in the Client; neither replaces the other.(source)

A Client takeover is expressed through a business Remote stream and is not the same as Gateway delivery. TimedQuestionWait keeps the original Host deadline and runs a timer only when no takeover is recorded.

The attachWait stream emits the current remaining time, and the Client counts down with its local clock. Focus, editing, and "answering slowly" states stay local. Cancelling the stream releases the corresponding takeover record; when the last taker leaves, the Host restores the original deadline.

With no taker, the timeout aborts the foreground waterfall's own signal and returns pending without cancelling the Turn. Gateway and api-remotes contain no question-specific timing policy — that division keeps timing logic in exactly one place.

The userQuestions projection

The projection records questions and settlements, never wait state, focus, or deadlines.(source)

The userQuestions projection folds existing events into an answerable set and a settled set. Its criteria are restrained: every request/header records the exact tool schema the model saw, and the projection tracks native calls only when the header declares the timed ask_user_question schema with a timeout parameter — the blocking legacy tool never declares it.

Tracking rules: a native tool/call opens a question; tool/result marks it continued in exactly two cases — a pending payload, or the synthetic TOOL_OUTCOME_UNKNOWN result written by Session resume repair. An answer batch moves it, with that batch, into settled; any other result or failure discards it.

A run_code PTC sub-call that returns pending in a tool/ptc-dispatch result also enters the projection, even though the request header lists only run_code.

Late reply settlement is precise: only when the message is admitted as a user/message does the continued question move into settled with the answer batch carried by that message. The reason is concrete: the timed call's own result records a timeout, leaving no transcript row where the user's final choice could be read.

A queued reply can be cancelled before admission, leaving the question answerable. When the reply body holds no readable batch, the call settles with zero answers; when the reply points at a call no longer in the answerable set, nothing changes.

answer admission and errors

Open questions go through the waterfall only; once continued, they go through Remote.(source)

An open question can only be answered through the waterfall. After it becomes continued, the answer Remote method enqueues a user message to the owning agent and wakes it when idle. The message has source set to user-question-reply, outcome set to answered, and a body carrying the answer_to_pending_question payload.

Three admission rules: an open or unknown call returns false; a second submission while the reply is queued rejects with REPLY_QUEUED, including after a Host restart; an answer batch with a missing or duplicated question rejects with BAD_ANSWER.

Two commonly misjudged behaviors: collapsing the Client panel sends nothing, and a foreground timeout ends only the tool wait. A continued question has no deadline and stays answerable until a reply enters the session. On Host restart with the Session reopened, the Remote layer restores the root agent and later replies arrive as a new turn.

The error type is UserQuestionError, extending HarnessError, so ctx.tools.execute() preserves { name, code } for model-facing tool failures such as EMPTY_QUESTIONS, BAD_INTENT, NO_PROVIDER, ASK_ABORTED, or UI-side cancellation.

Verification: answer after a timeout

Verify that a timeout is not a failure and that a late reply settles exactly once.(source)

  1. Submit a timed question without answering and assert the tool returns { pending: true, callId } with the turn still open.
  2. Call answer and assert a user message is enqueued to the owning agent and it is woken when idle.
  3. Submit again while the reply is queued and assert REPLY_QUEUED.
  4. Submit a batch missing one question id and assert BAD_ANSWER.
  5. Restart the Host, answer the same question, and assert the late reply enters as a new turn and settles.
  6. Cancel an idle-injection queued reply before admission and assert the question is still answerable.

If the original tool result is rewritten after step 2, the implementation wrote the late reply back into the old call, violating "a timed call records a timeout."

For approvals combined with questions, see approval and user questions; for the plan review path, see plan mode state recovery.

One line to close: intent changes display only, pending is not an answer, the deadline sits in the Host while the countdown sits in the Client, the projection records no waiting, and a late reply settles once at message admission.

ChatGPTClaudeGrok / X / CursorGemini

FAQ

Is DSH plugin pending an empty answer?

No. DSH plugin's pending only means the question can still be answered. DSH plugin states it is not an empty answer, rejection, confirmation, or authorization.

Does a DSH plugin foreground timeout cancel the whole turn?

No. DSH plugin's foreground timeout ends only the tool wait. DSH plugin aborts the foreground waterfall's own signal and returns pending without cancelling the Turn.

Does a late DSH plugin reply rewrite the tool result?

No. The original DSH plugin tool result records the timeout. DSH plugin moves the question and answer batch into settled when the reply becomes a user/message, and the transcript reads the choice there.

What happens when a DSH plugin answer is submitted twice?

It is rejected. DSH plugin reports REPLY_QUEUED while the reply is still queued, and rejects the duplicate after a Host restart as well.

Related Terms

AskUserQuestionIntent
AskUserQuestionIntent is caller-declared presentation intent with only plan-review and approval kinds; it changes display, never answer encoding.— packages/interaction/user-questions/src/index.ts
TimedUserQuestionResult
TimedUserQuestionResult is a timed question outcome: either the full answer batch or a pending marker carrying a callId.— packages/interaction/user-questions/src/index.ts
UserQuestionState
UserQuestionState says whether a question can still return an answer from the tool: open or continued.— packages/interaction/user-questions/src/index.ts
SettledUserQuestion
SettledUserQuestion is one settled timed question with its callId and the recorded answer batch.— packages/interaction/user-questions/src/index.ts

Sources