Skip to content

Python: Preserve empty hosted MCP allowlists - #8576

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
eavanvalkenburg:hosted-mcp-allowlist-assessment
Sep 22, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
eavanvalkenburg:hosted-mcp-allowlist-assessment

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Member

Motivation & Context

Preserve explicitly supplied empty allowed_tools lists when constructing hosted MCP tool configurations.

Description & Review Guide

  • What are the major changes? Update the OpenAI and Foundry MCP helpers to distinguish None from an empty list, and document the distinction.
  • What is the impact of these changes? Empty lists are retained in serialized requests. Omitted and nonempty lists, approval settings, and authentication configuration retain their existing behavior.
  • What do you want reviewers to focus on? Regression coverage for construction and SDK request serialization, including Foundry URL and project-connection configurations.

Related Issue

N/A.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after a language prefix) — a workflow keeps the label and title prefix in sync automatically.

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.

Copilot review overview

🟢 Approval recommended

The focused behavior change is documented and comprehensively covered through request serialization.

Review effort: Balanced
Findings: None

What changed in this PR

Preserves explicitly empty hosted MCP allowed_tools lists across OpenAI and Foundry request serialization.

Changes:

  • Distinguishes None from empty allowlists.
  • Documents the behavior.
  • Adds construction and wire-format regression tests.
File Description
python/​packages/​openai/​agent_framework_openai/​_chat_client.py Preserves empty OpenAI MCP allowlists.
python/​packages/​openai/​tests/​openai/​test_openai_chat_client.py Tests OpenAI configuration and serialization.
python/​packages/​foundry/​agent_framework_foundry/​_chat_client.py Preserves empty Foundry MCP allowlists.
python/​packages/​foundry/​tests/​foundry/​test_foundry_chat_client.py Tests Foundry URL and connection configurations.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot 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.

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): c0afb6c3257f
Model: gpt-5.6-sol-fast

Overview

The PR correctly distinguishes an omitted hosted MCP allowlist from an explicitly empty one in both OpenAI and Foundry configuration helpers. Parameterized tests cover omitted, empty, and nonempty values through actual SDK request serialization, while preserving Foundry URL/project-connection and header precedence. No publishable Critical, High, or Medium defect was established in the changed behavior.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

Merged via the queue into microsoft:main with commit 9c6fea2 Sep 22, 2026
53 checks passed
@eavanvalkenburg
Eduard van Valkenburg (eavanvalkenburg) deleted the hosted-mcp-allowlist-assessment branch September 22, 2026 12:06
ZedingZhang (ZedingZhang) pushed a commit to ZedingZhang/agent-framework that referenced this pull request Sep 29, 2026

This branch was previously deployed

1 inactive deployment
github-app-auth — c0afb6c3 Deployed Sep 21, 2026 by eavanvalkenburg via team_check #4932
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.

3 participants