Repository navigation
feat(tools): add dialog tools to answer blocking modal dialogs - #116
Merged
Merged
Conversation
… Studio Adds dialog_list and dialog_respond. A modal dialog such as "The source code is different from the original version" or "Hot Reload changes not supported" holds the Visual Studio UI thread, so the tool call that raised it never returns and every other tool that needs that thread waits behind it. An agent had no way to see the dialog or answer it. Neither tool touches the UI thread. Discovery is Win32 window enumeration, which reads window state without sending messages and so cannot hang. A window is a blocking dialog when it is visible and enabled and its owner has been disabled, which is how Win32 and WPF both implement modality, or when it is an unowned native dialog. Out-of-process windows owned by a VS window are included. Reading a dialog and clicking a button use UI Automation, which covers message boxes, task dialogs and WPF dialogs alike. Those calls run on a dedicated MTA thread under a timeout, so a dialog that stops responding is still listed by title rather than hanging the tool. Buttons are matched by name, ignoring case, access key markers and trailing ellipses; ambiguous, missing and disabled buttons are refused with the list of real buttons. StreamJsonRpc dispatches requests concurrently, so these calls are served while the call that raised the dialog is still waiting on it. UI Automation lives in the extension rather than the server because the server is a self-contained single-file publish and would otherwise have to carry the whole Windows Desktop runtime.
CalvinAllen
force-pushed
the
feat/tools/dialog-tools
branch
2 times, most recently
from
October 1, 2026 20:32
503302b to
525a460
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
dialog_listanddialog_respond, so an agent can see and answer the modal dialogs that block Visual Studio, such as "The source code is different from the original version" or "Hot Reload changes not supported".A modal dialog holds the VS UI thread. The tool call that raised it doesn't return, and every other tool that needs that thread waits behind it. Until now nothing could see the dialog, let alone answer it.
dialog_listreturns each dialog VS is waiting on: an id, the title, the message text and the buttons.dialog_respondclicks a button by name. Matching ignores case,&access-key markers and trailing ellipses. If the name matches nothing, matches two buttons, or the button is disabled, the tool refuses and lists the real buttons. The result says whether the dialog closed and which dialogs are still open, since one answer can raise another prompt.How it works
Services/DialogAutomation.csis in the extension, not the server. The server ships as a self-contained single-file exe and would otherwise have to bundle the whole Windows Desktop runtime.Tests
DialogAutomationTestscontains:The first WPF window in a fresh process takes about 8 s to start, so the test's wait for a dialog to appear is 60 s. Only a failing test waits that long.
Type of Change
feat- New featurefix- Bug fixdocs- Documentation onlyrefactor- Code change that neither fixes a bug nor adds a featuretest- Adding or updating testschore- Maintenance tasksci- CI/CD changesRelated Issues
Related to #112. This needs testing inside Visual Studio before the issue can be closed.
Checklist
Additional Notes
Still to test inside Visual Studio. The automated tests use stand-in dialogs in the test process, not VS's own. Worth checking each dialog from the issue:
dialog_listanswers while the call that raised the dialog is still waitingdialog_respondcloses the dialog, and the blocked call then completesKnown limitation. The call that raised the dialog still waits until the MCP client's own timeout; it doesn't fail early. The tool descriptions tell agents to try
dialog_listwhen a call hangs or times out. Making blocked calls return early would be a separate change.