Skip to content

fix: correct end-of-init message logic for existing project + existing deployment#8318

Open
v1212 wants to merge 2 commits into
Azure:mainfrom
v1212:fix/init-end-message-logic
Open

fix: correct end-of-init message logic for existing project + existing deployment#8318
v1212 wants to merge 2 commits into
Azure:mainfrom
v1212:fix/init-end-message-logic

Conversation

@v1212
Copy link
Copy Markdown
Collaborator

@v1212 v1212 commented May 22, 2026

Summary

Fixes the end-of-init message incorrectly recommending azd up when the user selected an existing project with an existing deployment (no provisioning needed).

Root cause: len(a.deploymentDetails) == 0 was used to detect whether new provisioning is needed, but existing deployments also populate this slice.

Fix: Replace with an explicit needsProvision boolean set only when a new model deployment is created (deploy-from-catalog path). This aligns init.go with the pattern already used in init_from_code.go.

Truth table

Project Model config Needs provision? Message
Existing Use existing deployment No azd deploy
Existing Deploy from catalog Yes azd up
Existing Skip No azd deploy
New Deploy from catalog Yes azd up
New Skip Yes azd up

Follow-up to #8292 — identified by @wbreza in re-review.

…g deployment

The end message incorrectly recommended 'azd up' when the user selected
an existing project with an existing deployment (no provisioning needed).

Root cause: len(a.deploymentDetails) == 0 was used to detect whether new
provisioning is needed, but existing deployments also populate this slice.

Fix: Replace with an explicit 'needsProvision' boolean that is only set
when a new model deployment is created (deploy-from-catalog path). This
aligns init.go with the pattern already used in init_from_code.go.

Follow-up to Azure#8292.
@v1212 v1212 marked this pull request as ready for review May 22, 2026 01:35
Copilot AI review requested due to automatic review settings May 22, 2026 01:35
Copy link
Copy Markdown
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

Fixes the “next steps” messaging at the end of azd ai agent init so it no longer recommends azd up when the user chose an existing Foundry project with an existing model deployment (i.e., when no new provisioning is required).

Changes:

  • Introduces an explicit needsProvision flag on InitAction to represent whether the init flow configured a new model deployment that requires provisioning.
  • Updates the end-of-init message logic in init.go to use needsProvision instead of len(deploymentDetails) == 0.
  • Sets needsProvision = true when the flow falls through to “deploy new model deployment” logic in getModelDeploymentDetails.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cli/azd/extensions/azure.ai.agents/internal/cmd/init.go Switches end-of-init guidance to rely on needsProvision (avoids misclassifying existing deployments as needing azd up).
cli/azd/extensions/azure.ai.agents/internal/cmd/init_models.go Sets needsProvision when configuring a new model deployment (deploy-from-catalog / deploy-new path).

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init.go Outdated
@github-actions github-actions Bot added the ext-agents azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes} extensions label May 22, 2026
Extract initCompletionNeedsDeploy() helper and add
TestInitCompletionNeedsDeploy covering the truth table:
- existing project + no new deployments -> azd deploy
- existing project + new model deployed -> azd up
- no project set -> azd up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.{agents,connections,inspector,projects,routines,skills,toolboxes} extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants