Skip to content

Implement clientIO stubs on Shell#2244

Open
GeorgeNgMsft wants to merge 6 commits intomainfrom
dev/georgeng/shell_clientio
Open

Implement clientIO stubs on Shell#2244
GeorgeNgMsft wants to merge 6 commits intomainfrom
dev/georgeng/shell_clientio

Conversation

@GeorgeNgMsft
Copy link
Copy Markdown
Contributor

image image

When the shell is connected to an agent-server, agents can now ask the user questions and wait for a response — matching behavior that already existed in the CLI. Previously, any agent-initiated prompt
(yes/no confirmation, multi-choice question) would silently hang for 10 minutes before timing out, because the shell's handlers were unimplemented stubs.

The shell now renders these prompts inline in the chat view using the existing choice panel UI, and correctly handles the multi-client case: if another connected client (e.g. the CLI) answers first, the
shell dismisses its own panel and shows a "[answered by another client]" notice. Server-side cancellations (e.g. timeout) similarly dismiss the panel with an "[interaction cancelled]" notice. Both binary
yes/no and arbitrary multi-choice questions are handled through a single unified code path, consistent with the protocol unification introduced in PR #2194.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements real deferred-interaction handling in the Shell renderer so that, when connected to an agent-server (SharedDispatcher), agent-initiated questions/prompts are rendered inline and can be dismissed when another client answers or when the server cancels the interaction.

Changes:

  • Implemented requestInteraction / interactionResolved / interactionCancelled handling in the Shell renderer clientIO to support connected-mode deferred interactions.
  • Added ChatView.showInteractionQuestion(...) to render deferred "question" interactions inline via the existing choice panel UI.
  • Added a Playwright integration test suite exercising the deferred-interaction UI flow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
ts/packages/shell/test/interactionUI.spec.ts New Playwright integration tests for deferred-interaction UI behavior.
ts/packages/shell/src/renderer/src/messageContainer.ts Exposes the underlying message div to enable inserting/removing choice panels from outside MessageContainer.
ts/packages/shell/src/renderer/src/main.ts Implements Shell-side deferred interaction handling and wires responses back to the dispatcher.
ts/packages/shell/src/renderer/src/chat/chatView.ts Adds a unified UI path to render deferred "question" interactions inline using ChoicePanel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ts/packages/shell/test/interactionUI.spec.ts
Comment thread ts/packages/shell/src/renderer/src/chat/chatView.ts Outdated
Comment thread ts/packages/shell/src/renderer/src/chat/chatView.ts
Comment thread ts/packages/shell/src/renderer/src/chat/chatView.ts Outdated
Comment thread ts/packages/shell/src/renderer/src/main.ts
Comment thread ts/packages/shell/src/renderer/src/main.ts Outdated
@GeorgeNgMsft GeorgeNgMsft marked this pull request as ready for review April 24, 2026 00:08
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