Skip to content

fix: Update token budget limits - Microsoft.AIInfraOptimization - #10580

Open
Kunal Karmakar (kkarmakarMS) wants to merge 3 commits into
Azure:mainfrom
kkarmakarMS:main
Open

Kunal Karmakar (kkarmakarMS) wants to merge 3 commits into
Azure:mainfrom
kkarmakarMS:main

Conversation

@kkarmakarMS

@kkarmakarMS Kunal Karmakar (kkarmakarMS) commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Suppressions
️✔️ None ️✔️ None

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aiinfraoptimization

AAZ PR: Azure/aaz#1165

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 05:15
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟡 Changes recommended

The command tests lack regression coverage for both token fields above the old 131072 ceiling, including acceptance at the new upper boundary and rejection above it.

1 open issue
What changed in this PR

Updates argument validation for az aiinfraoptimization recommendvmsku to match the token-budget limits in the linked AAZ change.

Changes:

  • Raises the maximum for both token-budget fields from 131072 to 2147483647, retaining a minimum of zero.
  • Changes the help example’s model parameter count to 70 billion.
File Description
src/​aiinfraoptimization/​azext_aiinfraoptimization/​aaz/​latest/​aiinfraoptimization/​_recommendvmsku.py Increases token argument limits and adjusts the documented example.

Review effort: Balanced

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@x-engineering-agent

x-engineering-agent Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

X Engineering Agent Pull request review: Comments

Kunal Karmakar (@kkarmakarMS) Both client-side token limits increase to 2147483647 while retaining integer serialization and the zero minimum. The release note and version bump are consistent with that change. The focused assertions verify client validation and request mapping, but service acceptance of the expanded range remains unverified; the recording concern below needs attention before merge.

Check Status Detail
Upstream CI Passed The handoff reports six completed checks, five passed and zero failed.
Agent live tests Not run This is a review-only PR.
Regression coverage Not applicable Not applicable to the changed files.
Findings 1 medium findings 1 medium
Risk Risk 46/100 Medium Medium; owner review required

To address

Tick each item as you address it.

Review details

Upstream CI

The handoff reports six completed checks, five passed and zero failed. The author's checklist reports local style and extension-index checks, not expanded-range service validation.

Test validation

  • Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
  • Regression coverage: Not applicable to the changed files.

The new scenario test replaces command execution and output with request-body construction at test_aiinfraoptimization.py:89-95. Its assertions at lines 109 and 115 would fail with the old limits, and lines 119-126 check rejection above the new maximum. This is useful client-side coverage, not recorded ARM integration coverage. Existing scenarios use 8000/1024 and 4096/0, so they do not establish behavior above the old 131072 limit.

For src/aiinfraoptimization/azext_aiinfraoptimization/tests/latest/test_aiinfraoptimization.py::AiinfraoptimizationScenario::test_aiinfraoptimization_recommendvmsku_token_budget_limits, exercising the real operation is necessary before a live run can produce service evidence: the current patched calls cannot record that interaction. Retain the deterministic boundary assertions as unit coverage and add an unpatched command scenario for the expanded range; run the focused scenario live, commit its recording, then replay it.

Risk assessment

46/100 · Medium

The Medium rating is driven by public CLI behavior, dependency or supply chain, generated output.

  • Change scope: 4 changed files, 57 changed lines (+54 / -3), including 2 production files.
  • Affected components: aiinfraoptimization
  • Risk drivers: public CLI behavior (+18); dependency or supply chain (+18); generated output (+12)
  • Regression evidence: Changed regression tests are included, reducing risk.
  • Confidence: High because changed-line patches were available for every production file.
  • Required review: Owning-squad review is required for aiinfraoptimization before merge.

Ask the Agent

Tick a box to queue an action. Requires write access to this repository.

  • Re-review this PR
  • Run Agent live tests on this PR

X Engineering Agent · Reviewer · React with +1 or -1 to train the agent

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Agent reviewed this PR label Nov 11, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Request X Engineering Agent Ask the agent to triage this issue or review this PR X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants