fix(web): stop dismissing questions after a 60 second timeout#1059
fix(web): stop dismissing questions after a 60 second timeout#1059wbxl2000 wants to merge 2 commits into
Conversation
The server's question broker auto-expired AskUserQuestion requests after 60s, which dismissed the question even when the user simply needed more time. Remove the timeout, and the now-unused expires_at field, so a question stays pending until the user answers or explicitly dismisses it.
🦋 Changeset detectedLatest commit: 4cee9b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2159c20e29
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return new Promise<QuestionResult>((resolve, reject) => { | ||
| const timer = setTimeout(() => this._expire(questionId), this._timeoutMs); | ||
| timer.unref?.(); | ||
| this._pending.set( | ||
| questionId, |
There was a problem hiding this comment.
Clear pending questions when the turn is aborted
When a user aborts a prompt while AskUserQuestion is waiting, PromptService.abort() only cancels the agent-side RPC call; it does not settle this broker entry. The removed timer was the only remaining automatic cleanup, so the PendingQuestion now stays in _pending indefinitely, causing listPending()/session status to remain awaiting_question until the user manually dismisses the stale card or the server shuts down. Please add an abort/session cleanup path when removing the timeout.
Useful? React with 👍 / 👎.
When a prompt is aborted while an AskUserQuestion is pending, the agent's RPC call is cancelled but the broker entry was never settled, so it stayed in _pending and kept the session in awaiting_question until manual dismiss or shutdown. Thread the turn's abort signal to the question broker and dismiss the pending question when it fires.
Related Issue
No prior issue. Follow-up to #1056 — found while reviewing the
AskUserQuestionpath after fixing the web yolo auto-approve.Problem
In the web UI, an
AskUserQuestionrequest was silently dismissed if the user did not answer within 60 seconds. The server's question broker started a 60s timer per question and, on expiry, rejected it, which surfaced to the agent as "user dismissed the question without answering." This made questions unreliable whenever the user needed more than a minute to respond.What changed
expires_atfield from the question request (protocol, agent-core adapter, and web client types) and theevent.question.expiredemission/handling._pendingand the session inawaiting_questionuntil manual dismiss or shutdown (the removed timer had been the only automatic cleanup).Approvals keep their existing 60s timeout — this change is scoped to questions only. The
QUESTION_EXPIREDprotocol error code is left in place (now unused) to avoid a protocol-level removal in this PR; happy to drop it in a follow-up if preferred.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.