Skip to content

Python: Surface A2A preview consent URLs - #7606

Open
LeoZhaoo (LobsterQBA) wants to merge 3 commits into
microsoft:mainfrom
LobsterQBA:fix/7227-a2a-consent-source
Open

Python: Surface A2A preview consent URLs#7606
LeoZhaoo (LobsterQBA) wants to merge 3 commits into
microsoft:mainfrom
LobsterQBA:fix/7227-a2a-consent-source

Conversation

@LobsterQBA

@LobsterQBA LeoZhaoo (LobsterQBA) commented Aug 10, 2026

Copy link
Copy Markdown

Motivation & Context

When a Work IQ tool source returns CONSENT_REQUIRED with type: "a2a_preview", the Foundry Hosting responses server currently ignores the consent URL because it only accepts mcp sources. This leaves callers without the URL needed to complete consent.

Description & Review Guide

  • What are the major changes? Allow consent_url_from_error to recognize both mcp and a2a_preview consent sources, and add a regression test for the latter.
  • What is the impact of these changes? Responses clients can surface the consent URL for Work IQ A2A-preview tool sources while preserving the existing MCP behavior.
  • What do you want reviewers to focus on? The intentionally narrow source-type allowlist and its regression coverage.

Prepared with AI assistance; the change was reviewed and validated locally by the contributor.

Related Issue

Fixes #7227

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 any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings August 10, 2026 19:02
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Aug 10, 2026

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

Extends Foundry Hosting consent extraction to support Work IQ A2A-preview sources while preserving MCP behavior.

Changes:

  • Allows mcp and a2a_preview consent sources.
  • Adds an A2A-preview parser regression test.

Reviewed changes

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

File Description
_responses.py Expands the consent source allowlist.
test_responses.py Adds configurable test data and A2A-preview coverage.

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

Comment thread python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py Outdated
Comment thread python/packages/foundry_hosting/tests/test_responses.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/foundry_hosting/agent_framework_foundry_hosting
   _responses.py7119586%144–145, 159, 162–163, 213, 228, 290, 349–352, 388–389, 392, 396, 428, 507, 510, 514, 580, 642–643, 982, 994, 1446–1447, 1451, 1496, 1498, 1500, 1502, 1506, 1514, 1517–1521, 1523, 1533, 1537, 1550, 1584–1589, 1593–1594, 1602–1608, 1638–1639, 1641–1642, 1644, 1649, 1657–1658, 1660, 1665–1669, 1671, 1678–1679, 1681–1682, 1688, 1690–1694, 1704, 1710, 1734, 1740, 1746, 1748, 1750–1753, 1761, 1763
TOTAL45800423990% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
9306 36 💤 0 ❌ 0 🔥 2m 28s ⏱️

@giles17

Copy link
Copy Markdown
Contributor

LeoZhaoo (@LobsterQBA) please agree to the Contributor License Agreement above

@LobsterQBA

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@LobsterQBA

Copy link
Copy Markdown
Author

LeoZhaoo (LeoZhaoo (@LobsterQBA)) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

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.

.NET: Python: [Bug]: ResponsesHostServer does not surface Work IQ CONSENT_REQUIRED from a2a_preview source

4 participants