Skip to content

feat: pin the open async question above the chat input - #31312

Open
ibetitsmike wants to merge 7 commits into
mike/codagt-1460-async-ask-user-questionfrom
mike/codagt-1460-question-dock
Open

ibetitsmike wants to merge 7 commits into
mike/codagt-1460-async-ask-user-questionfrom
mike/codagt-1460-question-dock

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 Xum opened this PR for Mike.

Stack

This stack lets the agent in Coder Agents web UI chats ask a question with ask_user_question without ending its turn. Chats created through the API and plan mode keep the blocking tool.

  1. feat: let web UI chats ask questions without ending the turn #31310: chatd gives web UI chats an async ask_user_question whose options are one-line answers, and sends a web push.
  2. feat(site/src/pages/AgentsPage): show ask_user_question options as numbered one-line answers #31555: the question form shows options as numbered one-line answers that number keys pick, and keeps unsent answers per call.
  3. feat(site/src/pages/AgentsPage): show async question answers without their call line #31315: async answers show without their call line in the bubble, the queue, Copy, Edit and the prompt history.
  4. feat(site/src): answer async agent questions in the timeline while the agent works #31294: an async question card stays answerable while the agent works, and closes when a newer question replaces it.
  5. feat: pin the open async question above the chat input #31312 (this PR): the open async question is pinned above the chat input, plus docs.

Refs CODAGT-1460

Why

In #31294 an async question is answered in its transcript card. The agent keeps working after it asks, so the card scrolls away under new output and is easy to miss. This PR moves the answer form into a panel above the chat input while the question is open.

The Open question panel above the chat input while the agent keeps working. The transcript card points to the panel, and the panel lines up with the input.

What changes (site/src, docs)

  • deriveAskUserQuestionState also returns openAsyncQuestion, the latest question while it is async and has no delivered answer. AskUserQuestionDock renders it above the chat input in a section labelled "Open question" that follows the chat width setting, is capped at 60% of the viewport height, scrolls on its own and shrinks before the input does. Its action row sticks to the bottom of the panel.
  • While a question is docked, its transcript card shows the question with "Answer in the question panel above the chat input.", so there is only one answer form. The card is matched by call occurrence, not by call ID.
  • The panel header collapses the form and keeps its state; a collapsed question set shows how many questions are answered. Back and Next scroll the panel to its top.
  • Sending an answer hides the panel while the answer waits in the queue, and focus returns to the chat input unless the user moved it during the send. Removing the queued answer brings the panel back with its draft.
  • A newer async question replaces the panel with a fresh, expanded form, also when the provider reuses the call ID: the panel is keyed by call ID and start time.
  • While the user edits an earlier message, the panel is read-only, with disabled options and no Submit. Saving the edit clears the queue and can remove the question, so an answer sent during the edit could be lost.
  • Plan-mode (blocking) questions never dock, and read-only views (archived chats, other users' chats) get no panel. Screen readers hear the open question once, from its transcript card.
  • docs/ai-coder/agents/index.md gets a "Questions outside plan mode" section: the agent keeps working, an answer sent while it runs joins the end of the queue, the panel, the read-only state during an edit, the number keys, and the push notification.

Screenshots

Taken from Storybook on this branch. The full-page shots use the AgentChatPage story harness with a two-question transcript that is not committed.

Number key 2 picks the second answer Enter moves to question 2
Pressing 2 selects and focuses the second answer row Question 2 of 2 with Back and Submit
Collapsed panel Phone, after a reload
The collapsed panel header shows Question 2 of 2 and 1/2 questions answered At 390 px the panel and the chat input both fit; the saved draft reopened on question 2

From the lower layers:

Delivered answers (#31315) Queued answer (#31315)
Answer bubbles without the call line, one starting with a skill chip The queue row shows Answer: before the answer text
Card with a queued answer (#31294) Replaced question (#31294)
The transcript card shows the submitted answer while it waits in the queue An async question replaced by a newer one shows This question is closed.

Validation

Vitest (ChatPageContent.test.tsx, AgentChatPage.test.tsx, askUserQuestionState.test.ts, questionDraft.test.ts) and the Storybook tests for the touched stories pass, as do biome, oxlint, tsc, knip and the pre-commit hook. Earlier remote dogfood UAT rounds of the combined stack with a real model checked the panel on short and phone viewports, a queued answer hiding the panel and being delivered once, the panel coming back with its draft after the queued answer was removed, and the read-only panel during a history edit.

Accepted limit

The panel reads the loaded transcript. The newest history page loads the whole active turn (#30524), except past 1,000 messages or after a failed fill request; then a question outside the page is docked once the user scrolls back to it.

Known follow-ups (not in this stack)

  • The panel comes before the chat input in Tab order, and the queued-message list renders between the panel and the input.
  • A newer question that arrives while the first answer is still queued takes over the panel.

@ibetitsmike
ibetitsmike added this pull request to stack #31311 October 27, 2026 00:00
@linear-code

linear-code Bot commented Oct 27, 2026

Copy link
Copy Markdown

CODAGT-1460

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T22:56:17.699933Z c455707 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2496ad2206

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b017ded10c

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3c01a3e22

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@ibetitsmike ibetitsmike changed the title feat(site/src): pin the open async question above the chat input feat: pin the open async question above the chat input Oct 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ca2b90b00

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d124fe0cb

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 54caac1674

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 255b19bdcd

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 2f9c75f713

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Xum posted this comment for Mike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: eccfb615f2

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e4c125085

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 825e318678

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: c4557074f5

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@DanielleMaywood DanielleMaywood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was performed by ai-review, an automated review bot.

3 inline findings and 1 below.

whole PR

SCOPE-1: This PR changes 1355 lines in 19 files (limit 1000). Split it into smaller PRs.

Remedy: split

Coverage
Coverage: 19 of 20 files reviewed, 1 unsupported; 35 rules.
Candidates: 259 found, 216 outside changed lines, 0 already discussed, 43 evaluated.
Findings: 4 (8 sites, 3 pre-existing sites), 0 over budget, 0 failed.
Model: deepseek/deepseek-v4.1-flash; 37 questions, 37 answered, 0 abstained, 0 cached; 0 uncalibrated findings held back; 36919 input and 9623 output tokens.

@mafredri
mafredri force-pushed the mike/codagt-1460-question-dock branch from c455707 to b3bb1af Compare November 3, 2026 20:24

@coderagents coderagents Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation check for PR #31312 (updated head).

Comment thread docs/coder-agents/index.md Resolved
Comment thread docs/coder-agents/index.md Resolved
@@ -264,7 +264,8 @@ Sub-agents do not have access to these tools and cannot create workspaces or spa
`spawn_agent` with `type=computer_use` additionally requires an Anthropic or OpenAI provider and the virtual desktop feature to be enabled by an administrator.
`read_skill` and `read_skill_file` are available when the workspace contains skills in its `.agents/skills/` directory.

`propose_plan` and `ask_user_question` are only available while plan mode is active.
`propose_plan` is only available while plan mode is active.
In chats created through the API, `ask_user_question` is also only available while plan mode is active.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: This API caveat serves an API reader on a page whose reader is the dashboard user, and docs/reference/api/chats.md has no mention of ask_user_question at all (grep = 0), so the API reader gets this only out of place. (Reader Advocate)

Rule: docs/.style/style-guide/audience-and-scope.md#pick-one-audience-per-page (also #give-the-audience-only-what-it-needs). The gate is real: coderd/x/chatd/turn_environment.go:724-728 exposes the async tool only when chat.ClientType == database.ChatClientTypeUi, so API chats keep ask_user_question plan-mode-only. Move this clause to the API/chat reference, or drop it here and keep the page scoped to the dashboard reader.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xum posted this reply for Mike.

Not changing this. The doc check on #31310 flagged the old line here ("propose_plan and ask_user_question are only available while plan mode is active") as false, and the fix is this split, which now lands in #31310. Dropping the API clause would leave readers with no statement of where the tool is available. The API reference is generated from the Swagger annotations, so a note there needs a code change outside this stack. Leaving this open for a maintainer to decide.

Comment thread docs/coder-agents/index.md Resolved
ibetitsmike and others added 3 commits November 6, 2026 19:09
The agent keeps working after an async question, so its transcript
card scrolls away under new output. While the question is open, its
answer form moves to a collapsible panel above the chat input, and
sending an answer returns focus to the chat input.

This is the net change of mike/codagt-1460-question-dock at
c455707, collapsed into one commit to rebase it onto main without
replaying the merges from the layer below. It includes the focus
handling from the closed #31372.
… sees

The tools table said dashboard questions never stop work, which is not
true in plan mode. The section led with the tool name instead of what
the reader sees, and repeated the API caveat that the tools section
already states.
This page names ask_user_question in its tools table and in the plan
mode section, so the section about the same tool outside plan mode
names it too.
@mafredri
mafredri force-pushed the mike/codagt-1460-question-dock branch from b3bb1af to 2ae5950 Compare November 6, 2026 19:25
…agt-1460-question-dock

# Conflicts:
#	site/src/pages/AgentsPage/components/ChatElements/tools/AskUserQuestionTool.tsx
#	site/src/pages/AgentsPage/components/ChatElements/tools/Tool.tsx
…pse controls

Names the custom-answer field by what the reader sees, says the
blocked-turn note comes from the tool's instructions, and says which
chats count as dashboard chats.

@coderagents coderagents Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: This section now names the same concept two ways. Lines 237 and 299 call it "chats created from the Coder dashboard"; the line you added coins "dashboard chat" for the identical concept. The new term appears only in its own definition sentence and is never used again, so a reader meets two names for one thing. (Continuity Editor)

Evidence: docs/coder-agents/index.md:237 (built-in tools table) and :299 both say "chats created from the Coder dashboard"; the added :300 says "dashboard chat".

Rule: docs/.style/style-guide/word-choice.md#one-term-per-concept. Pick one name per concept and use it every time.

Fix: do not introduce a second name. Fold the Agents-page clarification into line 299 and drop line 300, e.g. "In chats you start on the Agents page in the Coder dashboard, the agent can also call ask_user_question outside plan mode."

## Questions outside plan mode

In chats created from the Coder dashboard, the agent can also call `ask_user_question` outside plan mode.
A chat you start on the **Agents** page in the Coder dashboard is a dashboard chat.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: This section now names the same concept two ways. Lines 237 and 299 call it "chats created from the Coder dashboard"; the line you added coins "dashboard chat" for the identical concept. The new term appears only in its own definition sentence and is never used again, so a reader meets two names for one thing. (Continuity Editor)

Rule: docs/.style/style-guide/word-choice.md#one-term-per-concept. Pick one name per concept and use it every time.

Fix: do not introduce a second name. Fold the Agents-page clarification into line 299 and drop line 300, e.g. "In chats you start on the Agents page in the Coder dashboard, the agent can also call ask_user_question outside plan mode."


type SendChatMessage = SubmitChatTurnParams["sendMessage"];

export const useComposerFocusAfterSend = (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we adding this

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants