Skip to content

Python: Warn on unsupported AzureAIClient runtime tool/structured_output overrides - #3919

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 7 commits into
microsoft:mainfrom
eavanvalkenburg:fix-azure-ai-runtime-option-guard
Feb 16, 2026
Merged

Python: Warn on unsupported AzureAIClient runtime tool/structured_output overrides#3919
Eduard van Valkenburg (eavanvalkenburg) merged 7 commits into
microsoft:mainfrom
eavanvalkenburg:fix-azure-ai-runtime-option-guard

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Member

Summary

  • track AzureAIClient agent-creation tool names and structured output configuration
  • log a warning when runtime tools or structured_output differ from creation-time configuration and direct users to ResponsesClient
  • update AzureAIClient run option pruning to only remove keys that map to the concrete options TypedDict
  • add tests in the existing azure-ai client test file for runtime warnings and typed-dict-based option pruning behavior

Validation

  • uv run ruff format packages/azure-ai/agent_framework_azure_ai/_client.py packages/azure-ai/tests/test_azure_ai_client.py
  • uv run ruff check packages/azure-ai/agent_framework_azure_ai/_client.py packages/azure-ai/tests/test_azure_ai_client.py
  • uv run --directory packages/azure-ai pytest tests/test_azure_ai_client.py -k runtime_tools_override_logs_warning or runtime_structured_output_override_logs_warning or prepare_options_excludes_response_format or prepare_options_keeps_values_for_unsupported_option_keys -q

Copilot AI review requested due to automatic review settings February 13, 2026 11:57
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added the python Usage: [Issues, PRs], Target: Python label Feb 13, 2026
@github-actions github-actions Bot changed the title Warn on unsupported AzureAIClient runtime tool/structured_output overrides Python: Warn on unsupported AzureAIClient runtime tool/structured_output overrides Feb 13, 2026
@markwallace-microsoft

Mark Wallace (markwallace-microsoft) commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azure-ai/agent_framework_azure_ai
   _client.py2733786%378, 380, 423, 431–443, 456, 516, 531–536, 579, 614, 616, 649, 857, 860, 863–864, 866–869, 916
TOTAL20597325884% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3954 225 💤 0 ❌ 0 🔥 1m 13s ⏱️

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.

Pull request overview

This PR improves AzureAIClient ergonomics by tracking agent-creation configuration (tools + structured output) and warning when callers attempt unsupported runtime overrides, while also changing how request options are pruned to be based on the concrete client options TypedDict.

Changes:

  • Track creation-time tool names and structured output configuration; warn on runtime mismatches and point users to ResponsesClient.
  • Replace fixed “exclude list” pruning with TypedDict-driven pruning logic.
  • Add unit tests for runtime-override warnings and TypedDict-based option pruning.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/packages/azure-ai/agent_framework_azure_ai/_client.py Adds runtime override warnings + refactors run option pruning to depend on concrete options TypedDict.
python/packages/azure-ai/tests/test_azure_ai_client.py Adds tests for the new warnings and for TypedDict-based pruning behavior; updates test client factory.

Comment thread python/packages/azure-ai/agent_framework_azure_ai/_client.py Outdated
Comment thread python/packages/azure-ai/agent_framework_azure_ai/_client.py Outdated
Comment thread python/packages/azure-ai/agent_framework_azure_ai/_client.py Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merged via the queue into microsoft:main with commit b68d0f9 Feb 16, 2026
25 checks passed
@eavanvalkenburg
Eduard van Valkenburg (eavanvalkenburg) deleted the fix-azure-ai-runtime-option-guard branch June 30, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants