Skip to content

Extension auto install not triggering on AI extensions if one is installed already #6637

Description

@JeffreyCA

When multiple extensions share partial namespaces, the extension auto-install middleware does not prompt to install a missing extension if another extension with a shared namespace prefix is already installed.

Setup

Extension ID Namespace
Foundry Fine Tuning azure.ai.finetune ai.finetuning
Foundry Agents azure.ai.agents ai.agent

Scenario 1: No extensions installed ✅

Command: azd ai agent init

Observed (Expected):

The auto-install prompt correctly appears:

Command 'ai agent init' was not found, but there's an available extension that provides it

? Which extension would you like to install?  [Use arrows to move, type to filter]
> Foundry agents (Preview) (azd) - Extension for the Foundry Agent Service. (Preview)
  Foundry agents (Preview) (local) - Extension for the Foundry Agent Service. (Preview)

Scenario 2: Only finetuning extension installed ❌

Command: azd ai agent init

Observed:

Instead of the auto-install prompt, the help text is displayed:

$ azd ai agent init

Commands for the ai extension namespace.

Usage
  azd ai [command]

Available Commands
  finetuning    : Extension for Foundry Fine Tuning. (Preview)

Global Flags
    -C, --cwd string    : Sets the current working directory.
        --debug         : Enables debugging and diagnostics logging.
        --docs          : Opens the documentation for azd ai in your web browser.
    -h, --help          : Gets help for ai.
        --no-prompt     : Accepts the default value instead of prompting, or it fails if there is no default.

Use azd ai [command] --help to view examples and more information about a specific command.

Expected:

The auto-install prompt should appear, offering to install the azure.ai.agents extension (similar to Scenario 1).

Metadata

Metadata

Assignees

Labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions