Repository navigation
feat(site/src): answer async agent questions in the timeline while the agent works - #31294
ibetitsmike wants to merge 5 commits into
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed3fb3e9ee
ℹ️ 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".
Docs previewCheck 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. |
@codex review |
1 similar comment
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2173bbf13
ℹ️ 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".
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36c84fb8d1
ℹ️ 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".
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd3b9f357b
ℹ️ 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".
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42afde0c25
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
left a comment
There was a problem hiding this comment.
This review was performed by ai-review, an automated review bot.
4 inline findings and 1 below.
whole PR
SCOPE-1: This PR changes 1456 lines in 26 files (limit 1000). Split it into smaller PRs.
Remedy: split
Coverage
Coverage: 26 of 26 files reviewed; 35 rules.
Candidates: 430 found, 383 outside changed lines, 3 already discussed, 44 evaluated.
Findings: 5 (12 sites, 2 pre-existing sites), 0 over budget, 0 failed.
Model: deepseek/deepseek-v4.1-flash; 35 questions, 35 answered, 0 abstained, 0 cached; 0 uncalibrated findings held back; 36373 input and 17630 output tokens.
Experiments: 3 run, 0 passed, 3 vetoed, 0 unverified, 0 skipped for time.
vetoed: TYPE-1 site/src/pages/AgentsPage/components/ChatConversation/askUserQuestionState.ts:29: 1 new type error, first src/pages/AgentsPage/components/ChatConversation/askUserQuestionState.ts: TS2345 Argument of type 'string
vetoed: TYPE-1 site/src/pages/AgentsPage/components/ChatElements/tools/asyncAnswer.ts:50: 3 new type errors, first src/pages/AgentsPage/components/ChatElements/tools/AskUserQuestionTool.tsx: TS2345 Argument of type 'string
vetoed: TYPE-1 site/src/pages/AgentsPage/components/ChatElements/tools/asyncAnswer.ts:51: 3 new type errors, first src/pages/AgentsPage/components/ChatElements/tools/AskUserQuestionTool.tsx: TS2345 Argument of type 'string
| * A selector cannot build this list: useSyncExternalStore needs a stable | ||
| * snapshot. | ||
| */ | ||
| export const useUndeliveredQueuedMessages = ( |
There was a problem hiding this comment.
ABS-1: useUndeliveredQueuedMessages only reads useChatSelector to compute [ ...queuedMessages, ...promotingQueuedMessages.filter((message) => suppressedQ…. Make it a pure function that takes that data as arguments, and call the hooks in the component.
Remedy: make-pure
There was a problem hiding this comment.
Xum posted this reply for Mike.
Not changing this. The three selectors it reads are private to chatStore.ts, and the file already exposes composed reads as hooks (useChatMessages directly above follows the same pattern). A pure function would need those selectors exported and three more useChatSelector calls in ChatPageContent, which spreads the store's queue internals into the page. Leaving this open for you to decide.
95dfb69 to
ac20ef6
Compare
…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.
ac20ef6 to
8ebfda6
Compare
…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.
…t-1460-async-ask-user-question
…rate steps in upsertDurableMessages
There was a problem hiding this comment.
i'd be lying if i said i could understand what is going on here and why we've got such immense complexity for such a simple feature
Stack
This stack lets the agent in Coder Agents web UI chats ask a question with
ask_user_questionwithout ending its turn. Chats created through the API and plan mode keep the blocking tool.ask_user_questionwhose options are one-line answers, and sends a web push.Refs CODAGT-1460
What changes (
site/src)deriveAskUserQuestionStatedecides which question is open and which answer each card shows, from the transcript, the live stream and the queue:parseMessagesWithMergedToolsnow pairs each tool result with the nearest earlier call that has its ID, so an older result no longer makes a running question look finished.queued_message_id), so the card does not reopen while the promote runs.Validation
Vitest (
askUserQuestionState.test.ts,messageParsing.test.ts,chatQueueReconciliation.test.ts,ConversationTimeline.test.tsx,AskUserQuestionTool.test.tsx) and the Storybook tests for the touched stories pass, as do biome, oxlint,tsc, knip and the pre-commit hook. The hidden send error has no Vitest test, because its only outcome is whether an alert is shown. Earlier remote dogfood UAT rounds of the combined stack with a real model checked the closed card, the queued-answer timing, a running 25-second call that did not close the open question, and "Send now" delivering a queued answer once without the card reopening.Accepted limit
After a reload, the newest history page loads the whole active turn (#30524), so an open async question is on the page. The page stops filling at 1,000 messages or when a fill request fails; then a question outside the page shows once the user scrolls back to it.
Known follow-ups (not in this stack)