Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

azd x init could hang because the existing-directory confirmation prompt was rendered underneath the task list and remained waiting for input.

  • Prompt placement: Move the “extension directory already exists” confirmation to run before the task list starts, keeping the prompt visible and actionable.
  • Path validation: Reject non-directory collisions explicitly and simplify directory creation flow for clearer outcomes.
image

This PR also fixes local registry setup to use the absolute filepath to prevent the current working directory from affecting azd ext list, azd ext install, etc.

Original prompt

This section details on the original issue you should resolve

<issue_title>azd x init - "The extension directory

already exists." prompt disappears immediately</issue_title>
<issue_description>During azd x init, after entering Yes to continue creating the extension, if the extension directory exists already, I see the following for a split second:

(-) Running  Create local azd extension source (less than a second)
(o) Pending  Creating extension directory azure.ai.models
(o) Pending  Build extension
(o) Pending  Package extension
(o) Pending  Publish extension to local extension source
(o) Pending  Install extension

? The extension directory 'azure.ai.models' already exists. Do you want to continue?: [y/N] 

Then, one second later, the text "? The extension directory 'azure.ai.models' already exists. Do you want to continue?: [y/N] " disappears as the task list progresses to the second step (Creating extension directory):

(-) Skipped  Create local azd extension source
(-) Running  Creating extension directory azure.ai.models (less than a second)
(o) Pending  Build extension
(o) Pending  Package extension
(o) Pending  Publish extension to local extension source
(o) Pending  Install extension

The command hangs here as there's still a prompt awaiting user input. If I press a random key, the prompt briefly appears for a second, before disappearing again:

After pressing key like a:

(-) Skipped  Create local azd extension source
(-) Running  Creating extension directory azure.ai.models (3 seconds)
(o) Pending  Build extension
(o) Pending  Package extension
(o) Pending  Publish extension to local extension source
(o) Pending  Install extension

? The extension directory 'azure.ai.models' already exists. Do you want to continue?: [y/N] 
Enter a valid value

After 1 second:

(-) Skipped  Create local azd extension source
(-) Running  Creating extension directory azure.ai.models (4 seconds)
(o) Pending  Build extension
(o) Pending  Package extension
(o) Pending  Publish extension to local extension source
(o) Pending  Install extension

Enter a valid value

Video

azd.x.init.mp4

Unsure if this is a bug in extension or something in the UX components or extension framework. Interestingly, the validation error text "Enter a valid value" remains on the screen, which is what should happen for the confirmation message too.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 8 commits January 21, 2026 19:59
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix prompt disappearance for existing extension directory Ensure extension directory confirmation occurs before task list Jan 21, 2026
Copilot AI requested a review from JeffreyCA January 21, 2026 20:09
@JeffreyCA JeffreyCA changed the title Ensure extension directory confirmation occurs before task list azd x init - ensure extension directory confirmation occurs before task list Jan 21, 2026
@JeffreyCA JeffreyCA marked this pull request as ready for review January 21, 2026 23:36
@JeffreyCA JeffreyCA requested a review from wbreza as a code owner January 21, 2026 23:36
Copilot AI review requested due to automatic review settings January 21, 2026 23:36
Copy link
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 fixes a UX issue where the directory existence confirmation prompt in azd x init was being rendered underneath the task list, making it invisible and causing the command to hang while waiting for user input.

Changes:

  • Move the existing-directory confirmation prompt to execute before the task list begins (lines 184-208)
  • Add explicit validation to reject file collisions before prompting the user (line 186-187)
  • Pass the current working directory as a parameter to avoid redundant calls

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

@rajeshkamal5050 rajeshkamal5050 merged commit 167721e into main Jan 22, 2026
18 checks passed
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.

azd x init - "The extension directory <dir> already exists." prompt disappears immediately

3 participants