Fix aspire new: move OpenEditor after agent init prompt in VS Code extension#15552
Merged
adamint merged 1 commit intomicrosoft:mainfrom Mar 24, 2026
Merged
Conversation
When running 'aspire new' from the VS Code extension, OpenEditor was called immediately after template creation, which opened the new workspace and severed the CLI terminal connection before the 'configure AI agent environments' prompt could be shown. Move OpenEditor to after PromptAndChainAsync so the full CLI interaction completes before the workspace switches. Fixes microsoft#15551
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15552Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15552" |
mitchdenny
approved these changes
Mar 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an aspire new UX issue when invoked from the VS Code extension: switching the workspace (via OpenEditor) was happening before the CLI finished the interactive agent environment setup prompt, which could terminate the running terminal session and prevent the prompt from being shown.
Changes:
- Reorders
aspire newflow to run_agentInitCommand.PromptAndChainAsync(...)before invoking the VS Code extensionOpenEditorRPC. - Captures the chained exit code and returns it after the editor-open call.
Member
Author
|
/backport to release/13.2 |
Contributor
|
Started backporting to |
|
@adamint backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix aspire new: move OpenEditor after agent init prompt
Using index info to reconstruct a base tree...
M src/Aspire.Cli/Commands/NewCommand.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Aspire.Cli/Commands/NewCommand.cs
CONFLICT (content): Merge conflict in src/Aspire.Cli/Commands/NewCommand.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix aspire new: move OpenEditor after agent init prompt
Error: The process '/usr/bin/git' failed with exit code 128 |
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
When running
aspire newfrom the VS Code extension, theOpenEditorRPC call was made immediately after template creation but before the "Would you like to configure AI agent environments?" prompt (PromptAndChainAsync). Opening the new project folder replaces the current VS Code workspace, which destroys the terminal running the CLI process—so the agent init prompt is never shown to the user.This PR reorders the calls so that
PromptAndChainAsynccompletes beforeOpenEditoris invoked, allowing the full CLI interaction to finish before the workspace switches.IMO this should be seriously considered for 13.2.1 servicing, especially as it's very low risk. Users are prevented from setting up AI skills, which is an area we are prioritizing at the moment.
Fixes #15551
Checklist