Skip to content

Python: Agent name as required for AzureAIClient#2198

Merged
dmytrostruk merged 4 commits intomicrosoft:mainfrom
dmytrostruk:foundry-agent-name
Nov 14, 2025
Merged

Python: Agent name as required for AzureAIClient#2198
dmytrostruk merged 4 commits intomicrosoft:mainfrom
dmytrostruk:foundry-agent-name

Conversation

@dmytrostruk
Copy link
Member

Motivation and Context

Removed UnnamedAgent default name and made agent name as required parameter in AzureAIClient.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@dmytrostruk dmytrostruk self-assigned this Nov 13, 2025
Copilot AI review requested due to automatic review settings November 13, 2025 20:12
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Nov 13, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azure-ai/agent_framework_azure_ai
   _client.py1422284%165–168, 172–173, 175, 324–325, 329, 331–332, 334–342, 344
TOTAL14697212185% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2036 129 💤 0 ❌ 0 🔥 39.233s ⏱️

Copy link
Contributor

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 makes the agent name a required parameter for AzureAIClient by removing the default "UnnamedAgent" fallback value. Users must now explicitly provide an agent name either when initializing AzureAIClient or when creating a ChatAgent.

Key Changes:

  • Added validation to enforce agent_name as a required parameter with a clear error message
  • Removed redundant agent_name assignments after fetching or creating agents
  • Updated sample code to include the required name parameter
  • Added test coverage for the missing agent_name validation

Reviewed Changes

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

File Description
python/uv.lock Version bump for the ag-ui package
python/samples/getting_started/agents/azure_ai/azure_ai_with_code_interpreter.py Added name="MyCodeInterpreterAgent" parameter to demonstrate required agent naming
python/packages/azure-ai/tests/test_azure_ai_client.py Added test case to validate ServiceInitializationError when agent_name is missing
python/packages/azure-ai/agent_framework_azure_ai/_client.py Enforced agent_name as required with validation logic, removed redundant assignments, updated docstring for agent_name parameter, and added docstring for prepare_options method

@dmytrostruk dmytrostruk added this pull request to the merge queue Nov 14, 2025
Merged via the queue into microsoft:main with commit 8458b4a Nov 14, 2025
23 checks passed
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants