Skip to content

chore: merge upstream question stack (coder/coder#31312) - #17

Merged
ibetitsmike merged 29 commits into
mainfrom
mike/fork-upstream-stacks-2-question-stack
Nov 9, 2026
Merged

ibetitsmike merged 29 commits into
mainfrom
mike/fork-upstream-stacks-2-question-stack

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #6.

Merges the upstream question stack into fork main as upstream wrote it, so W5 and later workspaces can build on async ask_user_question and the question dock. Merge with a merge commit (not squash), like sync PRs, so a later merge of the same upstream branch brings only new commits.

Merged head: mike/codagt-1460-question-dock at 3ffaffd9d57db97e3396226dd6c3cde21cabda76 (fetched 2026-11-08 23:01 CET).

Upstream PR Branch Head merged Title
coder#31310 mike/codagt-1460-chatd-async-ask 9e7a2487eb feat: let web UI chats ask questions without ending the turn
coder#31555 mike/codagt-1460-question-options 8435c136a8 feat(site/src/pages/AgentsPage): show ask_user_question options as numbered one-line answers
coder#31315 mike/codagt-1460-async-answer-messages db1851b11b feat(site/src/pages/AgentsPage): show async question answers without their call line
coder#31294 mike/codagt-1460-async-ask-user-question b162a9c818 feat(site/src): answer async agent questions in the timeline while the agent works
coder#31312 mike/codagt-1460-question-dock 3ffaffd9d5 feat: pin the open async question above the chat input

Each listed head is an ancestor of the merged head. The branch forked from upstream main at e746555e3a, which fork main already contains, so the merge brings only the stack's 28 commits.

  • Conflicts: none. The merge applied cleanly on top of the chatd split.
  • Migrations: none. The stack touches coderd/x/chatd (8 files), site/src (47 files) and docs/coder-agents (2 files); no coderd/database file changes, so chatdmig route has nothing to add.
  • Fork rules: no fork code changed, no experiment flag involved (upstream gates the async path on dashboard chats, ClientType == ui).

Validation on the merge commit: go build ./coderd/x/chatd/..., go test ./coderd/x/chatd/ ./coderd/x/chatd/chattool/ against Postgres 17 (pass), biome check, tsc -p . and Vitest for the 12 touched test files (419 tests, pass).

ibetitsmike and others added 29 commits November 6, 2026 19:08
Outside plan mode, root chats created from the web UI get an async
ask_user_question. The call returns at once with an "async" marker, the
agent keeps working, and the answer arrives later as a user message whose
first line names the call. The chat owner gets one web push per question,
sent only after the step that holds the result commits.

Options now carry only a label: the schema asks for one short, complete
answer and drops the description field. Plan mode and chats created
through the API keep the blocking tool.

Refs CODAGT-1460
…label-only question options without a placeholder
… sees

The paragraph said the answer names the tool call, which only holds once
the web UI adds the call line later in the stack, and it described the
tool's call mechanics instead of what happens in the chat.
…raph

This page's tools table and the paragraph above name each tool, so the
paragraph about ask_user_question names it too. The only wrong claim
was that the answer names the tool call, which the web UI does not do
until later in the stack.
…mbered one-line answers

The options are now one complete answer each (coder#31310), so the form
gives each answer its own numbered row that number keys pick, renders
the question as Markdown, and keeps unsent answers per call in local
storage so a reload does not lose them.

This is the net change of mike/codagt-1460-question-options at
922760c, collapsed into one commit to rebase it onto main without
replaying the merges from the layer below.
…their call line

An async answer's first line names the ask_user_question call for the
model. The bubble, the queue row, Copy, Edit and the prompt history now
leave that line out, and an edit adds it back on send so the answer
still answers its question.

This is the net change of mike/codagt-1460-async-answer-messages at
7518ffb, rebased onto queued-message editing (coder#29555). The editing
hook now loads history and queued targets through one path, so the
call line is split off where a target loads and kept on the loaded
target. Queued edits therefore hide and restore it too, and the guard
that keeps an edit opened during an earlier send uses the hook's
existing load counter.
…e agent works

An async question does not end the turn, so its card stays answerable
while the chat streams, and closes once a newer valid question replaces
it. Answers are matched to their call by occurrence, because providers
can reuse a call ID in a later turn.

This is the net change of mike/codagt-1460-async-ask-user-question at
95dfb69, collapsed into one commit to rebase it onto main without
replaying the merges from the layer below.
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 coder#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.
…an mode

This PR exposes ask_user_question outside plan mode in dashboard chats,
so the tools table and the plan mode note no longer call it
plan-mode-only. The architecture page names Coder as the actor.
…op comments that restate the code

Deletes doc comments that only repeat a name or describe the code below
them, and separates the form's setup steps with blank lines.
…op asyncAnswer comments that restate the code
…t-1460-async-ask-user-question

# Conflicts:
#	site/src/pages/AgentsPage/components/ChatElements/tools/AskUserQuestionTool.tsx
…ts and split long blocks

Deletes doc comments that describe the code below them and separates
the logical steps in the promote, timeline, and question form blocks
with blank lines.
…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.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum (AI agent) requested this on behalf of @ibetitsmike (pstack parity lead). Codex is now installed on the fork; head 58fb51f3ef.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T23:15:09.351740Z 58fb51f 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: 58fb51f3ef

ℹ️ 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
Owner Author

UAT

Run through Coder Agents on the local deployment, with a dev server built from this branch inside a docker-template workspace (isolation proof and leak audits clean in every round).

  • Round 1: BLOCKED on 58fb51f3ef71ef305d2a8099e714f5640c2ba7a1, chat 7d4bcbe2-b7ef-46d0-83c1-8b71b1eb9bd3. Environment only: the Colima disk was full, and the devcontainer template had no toolchain.
  • Round 2: BLOCKED on 58fb51f3ef71ef305d2a8099e714f5640c2ba7a1, chat ac10403a-39a7-44fc-a782-022a5fdc0d67. About a third of the scenarios passed. The queue scenarios could not run because chats without a workspace ended their turn at once.
  • Round 3: PASS on 58fb51f3ef71ef305d2a8099e714f5640c2ba7a1, chat ac10403a-39a7-44fc-a782-022a5fdc0d67. The test turns streamed on purpose, which made these scenarios testable:
    • An answer given while the agent runs joins the end of the queue, and the panel hides while the answer is queued.
    • Removing the queued answer brings the panel back.
    • An answer given after the turn ends starts a new turn.
    • Editing an earlier message makes the panel read-only and hides Submit.
    • A newer question replaces an unanswered one, and the old one shows as closed.
    • The panel survives a reload.
    • Plan mode ends the turn.
    • API chats (client_type=api) do not get ask_user_question.
    • Plain chats still work.

Non-blocking findings: all four are upstream behavior as written. Under the fork rule, the fork does not patch them.

  1. Enter with nothing selected records Skipped.
  2. A reload restores the answers but not the wizard step.
  3. "Open question" appears only as an aria-label.
  4. The collapsed header shows no answered count.

None of them comes from the merge.

The head is unchanged since the tested SHA. origin/main (b1f5f23ffe, which includes #16 and #25) merges into this branch without conflicts, and go build ./... passes on the merge result. main brings no coderd/x/chatd or site/ changes into the merge.

Xum acted for Mike: posted the UAT record for this PR.

@ibetitsmike
ibetitsmike merged commit 7e37c9b into main Nov 9, 2026
4 checks passed
@ibetitsmike
ibetitsmike deleted the mike/fork-upstream-stacks-2-question-stack branch November 9, 2026 01:49
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum (AI agent) merged this on behalf of @ibetitsmike after verifying the exact head 58fb51f: fork-ci green (build, chat-tests, graph, schema), 0 unresolved threads with the four Codex findings dropped as upstream code as written, UAT round 3 PASS on this head, and a clean merge with main b1f5f23 (no database files touched). Merged with a merge commit as 7e37c9b.

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.

2 participants