Increase default deployment capacity from 10 to 50 for agents#8874
Conversation
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>
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
There was a problem hiding this comment.
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-promptcapacity 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-promptmode, defaulting to 50 and then rounding up toCapacityStepcan makecapacityexceedMaxCapacity(or exceed it after rounding) and returnfalse, 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 toMaxCapacity(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
}
jongio
left a comment
There was a problem hiding this comment.
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.
…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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
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>
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
defaultDeploymentCapacityconstant (50) in the agents extension and passes it as the preferred capacity through all deployment resolution paths:PromptAiDeployment): SetsOptions.Capacityso the capacity prompt defaults to 50 instead of the SKU default.ResolveModelDeployments): SetsOptions.Capacityso resolved deployments use 50.resolveNoPromptCapacity): Uses 50 when the candidate has no capacity set, instead ofmax(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
azure.yamlare unaffected (they take precedence).Fixes: #8858