Skip to content

[ai agents extension] Use PromptAiDeployment in init-from-code for explicit SKU selection#6891

Closed
rajeshkamal5050 wants to merge 2 commits intoAzure:mainfrom
rajeshkamal5050:fix/init-from-code-sku-prompt
Closed

[ai agents extension] Use PromptAiDeployment in init-from-code for explicit SKU selection#6891
rajeshkamal5050 wants to merge 2 commits intoAzure:mainfrom
rajeshkamal5050:fix/init-from-code-sku-prompt

Conversation

@rajeshkamal5050
Copy link
Contributor

@rajeshkamal5050 rajeshkamal5050 commented Feb 25, 2026

Problem

The init-from-code flow auto-selected deployment SKU via resolveModelDeploymentNoPrompt, picking by priority (GlobalStandard first) without user visibility. This caused quota mismatches where:

  • Model prompt showed high available quota (aggregated across all SKUs)
  • Deployment failed because the auto-selected SKU (e.g., GlobalStandard) had zero quota

Fix

Replace resolveModelDeploymentNoPrompt with PromptAiDeployment in interactive mode so users explicitly select version, SKU, and capacity — matching the regular init flow. Users now see per-SKU quota and can choose accordingly.

In --no-prompt mode, resolveModelDeploymentNoPrompt is preserved as a fallback for non-interactive scenarios.

Changes

  • init_from_code.go: Call PromptAiDeployment in interactive mode, fall back to resolveModelDeploymentNoPrompt when --no-prompt is set

The init-from-code flow was auto-selecting the deployment SKU via
resolveModelDeploymentNoPrompt, which picked by priority (GlobalStandard
first) without user visibility. This caused quota mismatches where the
model prompt showed high available quota (from Standard SKU) but
deployment failed because GlobalStandard had zero quota.

Replace with PromptAiDeployment to prompt users for version, SKU, and
capacity selection — matching the regular init flow behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 25, 2026 18:13
@rajeshkamal5050 rajeshkamal5050 changed the title Use PromptAiDeployment in init-from-code for explicit SKU selection [ai agents extension] Use PromptAiDeployment in init-from-code for explicit SKU selection Feb 25, 2026
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 aims to improve the init-from-code flow by replacing automatic SKU selection with explicit user prompts, addressing quota mismatch issues where auto-selected SKUs had zero quota despite high aggregate availability.

Changes:

  • Replace resolveModelDeploymentNoPrompt with PromptAiDeployment to let users explicitly select model version, SKU, and capacity
  • Remove the unused resolveModelDeploymentNoPrompt function from InitFromCodeAction

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

Copy link
Contributor

@JeffreyCA JeffreyCA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trangevi do we still want --no-prompt support?

Keep resolveModelDeploymentNoPrompt for --no-prompt mode, use
PromptAiDeployment only in interactive mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

5 participants