Skip to content

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

Merged
xuming-ms merged 6 commits into
Azure:mainfrom
kkarmakarMS:main
Nov 19, 2026
Merged

xuming-ms merged 6 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: Ready for human review

Kunal Karmakar (@kkarmakarMS) No confirmed changed-line defects found. Both token limits expand consistently, request serialization preserves their values, and the release history matches version 1.0.0b2.

Check Status Detail
Upstream CI Passed The supplied snapshot has six completed checks, five passed and zero failures, with none…
Agent live tests Not run This is a review-only PR.
Regression coverage Not applicable Not applicable to the changed files.
Risk Risk 75/100 Critical Critical; owner review required
Review details

Upstream CI

The supplied snapshot has six completed checks, five passed and zero failures, with none pending.

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.

Manual inspection supplements that automated coverage classification. Under src/aiinfraoptimization/azext_aiinfraoptimization/tests/latest/, the author-provided test_aiinfraoptimization.py scenario and recordings/test_aiinfraoptimization_recommendvmsku_long_context.yaml exercise both values above 131072, match the serialized request body and assert contextLength=393217. test_aiinfraoptimization_unit.py exercises real command validation and serialization at 2147483647 and rejection at 2147483648 for each field. Reverting either limit breaks the positive cases. The scenario does not mock ARM responses; HTTP stubs are confined to the separate unit tests.

The recording does not establish service enforcement of the combined-token ceiling or model-context bound. Suggested focused scenario in test_aiinfraoptimization.py, with a corresponding recording: prompt-tokens=1048576, max-output-tokens=1 and model max-context-length=1048576 should produce a service validation error rather than a recommendation.

All six changed files were inspected. Framework implementation under azure-cli-core, the referenced AAZ source change, independent REST-spec agreement and runtime-matrix execution were not verified. The independent Reviewer covered every target; the focused contract pass returned no result after one retry.

Risk assessment

75/100 · Critical

The Critical rating is driven by security-sensitive behavior, public CLI behavior, dependency or supply chain and 1 additional signal(s).

  • Change scope: 6 changed files, 147 changed lines (+142 / -5), including 2 production files.
  • Affected components: aiinfraoptimization
  • Risk drivers: security-sensitive behavior (+28); 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).

@kkarmakarMS

Copy link
Copy Markdown
Member Author

Aditya Pujara (@a0x1ab) please could you execute /azp run ?

x-engineering-agent[bot]

This comment was marked as outdated.

@x-engineering-agent x-engineering-agent Bot added the X Engineering Agent Reviewed Agent reviewed this PR label Nov 17, 2026
@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[bot]

This comment was marked as outdated.

@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[bot]

This comment was marked as outdated.

@x-engineering-agent x-engineering-agent Bot removed the Request X Engineering Agent Ask the agent to triage this issue or review this PR label Nov 17, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@kkarmakarMS

Copy link
Copy Markdown
Member Author

Aditya Pujara (@a0x1ab) please could you execute /azp run ?

@kkarmakarMS Kunal Karmakar (kkarmakarMS) added Request X Engineering Agent Ask the agent to triage this issue or review this PR and removed X Engineering Agent Reviewed Agent reviewed this PR labels Nov 18, 2026

@x-engineering-agent x-engineering-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@x-engineering-agent x-engineering-agent Bot added X Engineering Agent Reviewed Agent reviewed this PR and removed Request X Engineering Agent Ask the agent to triage this issue or review this PR labels Nov 18, 2026
@xuming-ms

Copy link
Copy Markdown

/azp run

@azure-pipelines

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

@kkarmakarMS

Copy link
Copy Markdown
Member Author

xuming-ms CI tests are clean, please could you approve this and the associated aaz PR ?

@xuming-ms
xuming-ms merged commit 21f4e3a into Azure:main Nov 19, 2026
48 checks passed
@azclibot

Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ aiinfraoptimization-1.0.0b2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=192163046&view=results

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

Labels

X Engineering Agent Reviewed Agent reviewed this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants