Skip to content

Increase default deployment capacity from 10 to 50 for agents#8874

Merged
huimiu merged 2 commits into
mainfrom
trangevi/increase-default-deployment-capacity
Jun 30, 2026
Merged

Increase default deployment capacity from 10 to 50 for agents#8874
huimiu merged 2 commits into
mainfrom
trangevi/increase-default-deployment-capacity

Conversation

@trangevi

Copy link
Copy Markdown
Member

Motivation

The Azure SKU default capacity for model deployments is typically 10, which is too low for AI agent workloads. Users see "10" pre-filled in the capacity prompt during azd ai agent init, requiring manual adjustment every time. The recommendation from bug bash feedback is 30-50.

Approach

Introduces a defaultDeploymentCapacity constant (50) in the agents extension and passes it as the preferred capacity through all deployment resolution paths:

  • Interactive path (PromptAiDeployment): Sets Options.Capacity so the capacity prompt defaults to 50 instead of the SKU default.
  • Non-interactive path (ResolveModelDeployments): Sets Options.Capacity so resolved deployments use 50.
  • No-prompt fallback (resolveNoPromptCapacity): Uses 50 when the candidate has no capacity set, instead of max(minCapacity, 1).

The preferred capacity still respects SKU constraints -- if the SKU's max capacity is below 50, or remaining quota is insufficient, the system will clamp or reject as before.

Notes

  • User-provided capacity values in azure.yaml are unaffected (they take precedence).
  • Existing deployments with capacity already set are also unaffected.

Fixes: #8858

The SKU default capacity (typically 10) is too low for AI agents.
Set a preferred capacity of 50 in all deployment resolution paths:
- Interactive PromptAiDeployment calls
- Non-interactive ResolveModelDeployments calls
- No-prompt fallback in resolveNoPromptCapacity

The preferred capacity still respects SKU min/max constraints and
available quota - it will be clamped or rejected if insufficient.

Fixes #8858

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@trangevi trangevi requested a review from JeffreyCA as a code owner June 30, 2026 01:20
Copilot AI review requested due to automatic review settings June 30, 2026 01:20
@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag @RickWinter and @kristenwomack to let us know.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Azure AI Agents extension to prefer a higher default model deployment capacity (50) during agent initialization, reducing repeated manual adjustments for typical agent workloads.

Changes:

  • Introduces defaultDeploymentCapacity (50) and wires it into both interactive (PromptAiDeployment) and non-interactive (ResolveModelDeployments) deployment resolution.
  • Updates --no-prompt capacity fallback logic to use the new default when capacity is unset/invalid.
  • Updates unit/infra-init tests to reflect the new default capacity behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
cli/azd/extensions/azure.ai.agents/internal/cmd/init_models.go Adds the default capacity constant and applies it to interactive prompting and no-prompt fallback resolution.
cli/azd/extensions/azure.ai.agents/internal/cmd/init_models_test.go Adjusts resolveNoPromptCapacity test expectations and adds a new max-capacity edge case.
cli/azd/extensions/azure.ai.agents/internal/cmd/init_infra_test.go Updates the expected generated azure.yaml capacity value from 10 to 50.
cli/azd/extensions/azure.ai.agents/internal/cmd/init_foundry_resources_helpers.go Applies the preferred default capacity to non-interactive deployment resolution.
Comments suppressed due to low confidence (1)

cli/azd/extensions/azure.ai.agents/internal/cmd/init_models.go:575

  • azd-code-reviewer: In --no-prompt mode, defaulting to 50 and then rounding up to CapacityStep can make capacity exceed MaxCapacity (or exceed it after rounding) and return false, even when there’s a valid step-aligned capacity ≤ max (e.g., max=50, step=7 → 49). This can cause unnecessary init failures; consider clamping the defaulted capacity down to MaxCapacity (and step-align down) instead of failing.
	if candidate.Sku.CapacityStep > 0 && capacity%candidate.Sku.CapacityStep != 0 {
		step := candidate.Sku.CapacityStep
		capacity = ((capacity + step - 1) / step) * step
	}

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_models.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_foundry_resources_helpers.go Outdated
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_models_test.go
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_models.go
@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jun 30, 2026

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small, focused change that addresses a real user pain point from bug bash feedback. The constant is well-named, applied consistently across both interactive and non-interactive paths, and the tests cover the important edge cases.

One observation: there's no test for the interaction between CapacityStep rounding and MaxCapacity when both are in play. The existing tests cover step-alignment (no max) and max-exceeded (no step) independently, but not the compound case where defaultDeploymentCapacity is within max yet the step-rounded value exceeds it. See inline comment.

Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_models_test.go
…pdate docs

- Remove redundant int32() casts since defaultDeploymentCapacity is already int32
- Clamp defaulted capacity to MaxCapacity (step-aligned down) instead of
  failing, preventing unnecessary init failures in --no-prompt mode
- Update docs/examples to show capacity: 50

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Incremental review of 224c42c (1 new commit since my last review).

The clamping approach in
esolveNoPromptCapacity correctly handles the compound scenario I raised: when the defaulted capacity step-aligns UP past max (e.g., default=50, step=3 rounds to 51, exceeding max=50), the function now clamps to max and step-aligns DOWN (producing 48). This is better than rejecting outright since --no-prompt mode should accommodate rather than fail on valid SKUs.

The defaulted flag cleanly separates behavior: user-specified capacity that exceeds max still hard-fails (respecting explicit choices), while system-defaulted capacity gracefully clamps. Tests cover both the simple clamp (max=30, no step) and step-aligned clamp (max=50, step=7 producing 49).

No new issues. CI green.

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Incremental review of 224c42c (1 new commit since my last review).

The clamping approach in resolveNoPromptCapacity correctly handles the compound scenario I raised: when the defaulted capacity step-aligns UP past max (e.g., default=50, step=3 rounds to 51, exceeding max=50), the function now clamps to max and step-aligns DOWN (producing 48). This is better than rejecting outright since --no-prompt mode should accommodate rather than fail on valid SKUs.

The defaulted flag cleanly separates behavior: user-specified capacity that exceeds max still hard-fails (respecting explicit choices), while system-defaulted capacity gracefully clamps. Tests cover both the simple clamp (max=30, no step) and step-aligned clamp (max=50, step=7 producing 49).

No new issues. CI green.

@huimiu huimiu merged commit eaf0044 into main Jun 30, 2026
26 checks passed
@huimiu huimiu deleted the trangevi/increase-default-deployment-capacity branch June 30, 2026 11:47
github-actions Bot added a commit that referenced this pull request Jul 1, 2026
Adds a new 'Test coverage symmetry' section to go.instructions.md, sourced
from recurring reviewer feedback across three PRs (#8883, #8874, #8876).

Rule covers three patterns flagged by reviewers:
- Symmetric prompt paths (subscription ↔ location: success/error/cancel)
- Serialisation round-trip tests (save + reload, not just write direction)
- Compound constraint interactions (step-alignment × max-capacity)

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

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase the default deployment capacity from 10 to 50

4 participants