Skip to content

Conversation

alex3267006
Copy link
Contributor


Related command

This pull request introduces major improvements to the AKS Agent extension, focusing on simplifying LLM model setup and management for users. The most significant change is the addition of the new az aks agent-init command, which enables interactive configuration of LLM providers and models, removing the need for manual environment variable setup. Documentation and help text have been updated to reflect these changes, and new backend modules have been added to support provider selection and configuration management. There are also code changes to ensure configuration consistency and prevent conflicts.

User Experience and CLI Improvements

  • Added the new az aks agent-init command, allowing users to interactively add and configure LLM models for AKS troubleshooting. This command saves model configurations locally, supports multiple providers, and guides users through the setup process.
  • Updated documentation in README.rst and CLI help to highlight the new workflow: users no longer need to set environment variables manually, and can easily select or switch models using --model or --config-file.

Configuration Management and Validation

  • Introduced LLMConfigManager (llm_config_manager.py) for robust loading, saving, and retrieval of LLM model configurations, ensuring the last used or specifically selected model is used by default.
  • Added provider registry and interactive selection logic in llm_providers/__init__.py, making it easy for users to choose among Azure, OpenAI, Anthropic, Gemini, and other compatible providers.

Provider Support and Validation

  • Added new provider classes for Azure, OpenAI, OpenAI-Compatible, Gemini and Anthropic, each with schema-based parameter validation and live connection testing to ensure correct configuration before use.

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

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 wheel==0.30.0 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.

@alex3267006 alex3267006 requested a review from feiskyer as a code owner October 3, 2025 06:02
@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 06:02
Copy link

azure-client-tools-bot-prd bot commented Oct 3, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-agent
rule cmd_name rule_message suggest_message
⚠️ 1001 - CmdAdd aks agent-init cmd aks agent-init added

Copy link

Hi @alex3267006,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 3, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

github-actions bot commented Oct 3, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Contributor

@Copilot 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 introduces major improvements to the AKS Agent extension, focusing on simplifying LLM model setup and management. The key change is the addition of the az aks agent-init command for interactive LLM configuration, eliminating the need for manual environment variable setup.

  • Interactive LLM model configuration through az aks agent-init command
  • Support for multiple providers (Azure, OpenAI, Anthropic, Gemini, OpenAI-compatible) with validation
  • Configuration management system with local storage and model selection capabilities

Reviewed Changes

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

Show a summary per file
File Description
commands.py Added new agent-init command
custom.py Implemented aks_agent_init function and configuration management logic
agent/agent.py Added configuration conflict prevention
agent/llm_config_manager.py New configuration manager for LLM settings
agent/llm_providers/*.py Provider classes with validation and connection testing
tests/latest/*.py Test coverage for new functionality
_help.py Updated help text and examples
README.rst Updated documentation to reflect new workflow

Copy link

github-actions bot commented Oct 3, 2025

Copy link
Member

@mainred mainred left a comment

Choose a reason for hiding this comment

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

Thanks for your changes, the code change, docs and UTs are great.
Left the first-round review.

@alex3267006 alex3267006 changed the title Feature/eas llm setup {AKS}: introduce agent-init subcommand for llm setup Oct 14, 2025
@mainred
Copy link
Member

mainred commented Oct 14, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@alex3267006 alex3267006 reopened this Oct 14, 2025
@alex3267006
Copy link
Contributor Author

/azp run

Copy link

Commenter does not have sufficient privileges for PR 9268 in repo Azure/azure-cli-extensions

@mainred
Copy link
Member

mainred commented Oct 14, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@mainred
Copy link
Member

mainred commented Oct 14, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@mainred
Copy link
Member

mainred commented Oct 15, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

mainred
mainred previously approved these changes Oct 15, 2025
@alex3267006
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@mainred
Copy link
Member

mainred commented Oct 16, 2025

@yanzhudd please help merge this PR, thanks.

@yanzhudd
Copy link
Contributor

please resolve the code conflict

@mainred
Copy link
Member

mainred commented Oct 16, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@yanzhudd yanzhudd merged commit de3cea1 into Azure:main Oct 16, 2025
25 checks passed
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ aks-agent-1.0.0b6 ] : https://dev.azure.com/msazure/One/_build/results?buildId=140634879&view=results

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

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants