[release/13.2] Fix aspire new: move OpenEditor after agent init prompt#15553
[release/13.2] Fix aspire new: move OpenEditor after agent init prompt#15553adamint wants to merge 1 commit intomicrosoft:release/13.2from
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
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15553Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15553" |
There was a problem hiding this comment.
Pull request overview
Backports a fix to the aspire new command so that, when invoked from the VS Code extension, the AI agent initialization prompt can complete before the extension opens the newly created project (which would otherwise replace the workspace and terminate the CLI terminal session).
Changes:
- Moves
_agentInitCommand.PromptAndChainAsync(...)to run before the VS Code extensionOpenEditor(...)call. - Returns the agent-init (chained) exit code after optional editor opening.
|
Regression, low risk. Approved. Are there tests we can add here to protect against future regressions? |
Not until we get extension e2e tests working. Then, yes |
| var exitCode = await _agentInitCommand.PromptAndChainAsync(_hostEnvironment, InteractionService, templateResult.ExitCode, workspaceRoot, cancellationToken); | ||
|
|
||
| if (templateResult.OutputPath is not null && ExtensionHelper.IsExtensionHost(InteractionService, out var extensionInteractionService, out _)) |
There was a problem hiding this comment.
It's not obvious that this order is important.
Add a comment saying what has to happen here. Even better, also add a test to verify extension host isn't called until after the chain is complete.
It doesn't need to happen in this branch since it's to a release branch, but it should happen somewhere.
Description
Backport of #15552 to
release/13.2.Customer Impact
Testing
Manual testing
Risk
Low, the same operations are being performed. Workspace open is just being moved later
Regression?
It has been broken since the ai agent setup prompt was added