Skip to content

Render Codex asynchronous questions with interactive answers - #336512

Open
Ryan Ewen (RyanEwen) wants to merge 3 commits into
microsoft:mainfrom
RyanEwen:codex/fix-async-questions
Open

Ryan Ewen (RyanEwen) wants to merge 3 commits into
microsoft:mainfrom
RyanEwen:codex/fix-async-questions

Conversation

@RyanEwen

@RyanEwen Ryan Ewen (RyanEwen) commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex's request_user_input_async emits an agentMessage with delivery: "async" and structured questions. The current adapter treats that item as ordinary Markdown, leaving the question and suggested answers as text with no answer controls. This reproduces with the original VS Code 1.137.0 bundle and is independent of the feedback-review patch.

Route these items to the existing question carousel, including free-text answers. Codex continues working while the controls are open. If its native turn completes first, retain the host turn until the user answers or skips. Explicit answers use native turn/start, which steers active work or starts a continuation using the thread's existing settings. Ordinary messages and synchronous input requests keep their existing paths.

Interactive controls are restricted to owned sessions with an answer route; isolated subagent messages retain their existing text path. The acknowledged continuation ID is recorded before answer delivery resolves, with live-session and host/native ownership checks, so Stop targets it before its notification arrives.

The controller deduplicates items, reopens questions on delivery failure, cancels stale controls on replacement/disposal, and handles Stop during an in-flight answer. It also handles an answer RPC response arriving before the native turn-start notification. No suggested answer is automatically submitted. Late answer acknowledgements are ignored after cancellation or question replacement.

Fixes #336509.

Validation: 21 passing tests in the focused source suite (20 behavior tests plus the harness check), zero targeted TypeScript diagnostics, targeted ESLint and whitespace checks. Nineteen bundle tests pass against inspected Windows ARM64 and Ubuntu ARM64 1.137.0 bundles, including an unpatched regression reproduction and extracted patched dispatcher/answer-routing execution. Staged apply, idempotence and exact rollback passed. Pre-publication self-review found and corrected Stop and RPC/event ordering races. No full build or live interactive UI validation is claimed.

Public source snapshot, backport and validation: PR #336512 documentation. The bundle backport is installed on the inspected Windows and Ubuntu 1.137.0 hosts; activation still requires restarting their VS Code host processes.

AI disclosure: this comment and the related code were written with the assistance of AI.

Copilot AI 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.

🟡 Changes recommended

Stop can miss a newly started continuation, and subagent questions are routed to controls that cannot answer them.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Routes Codex asynchronous questions into the existing interactive question carousel while preserving turn continuity.

Changes:

  • Adds async-question lifecycle and delivery handling.
  • Integrates questions with Codex turn, stop, and disposal flows.
  • Adds focused behavioral tests.
File summaries
File Description
codexAsyncQuestions.ts Implements question state and answer delivery.
codexAgent.ts Connects async questions to Codex events.
codexAsyncQuestions.test.ts Tests controller behavior and races.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/platform/agentHost/node/codex/codexAgent.ts Outdated
Comment thread src/vs/platform/agentHost/node/codex/codexAgent.ts Outdated

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.

Codex asynchronous questions render as Markdown without answer controls

3 participants