Python: Surface A2A preview consent URLs - #7606
Conversation
There was a problem hiding this comment.
Pull request overview
Extends Foundry Hosting consent extraction to support Work IQ A2A-preview sources while preserving MCP behavior.
Changes:
- Allows
mcpanda2a_previewconsent 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.
| if ( | ||
| isinstance(error, dict) | ||
| and error.get("type") == "mcp" # type: ignore | ||
| and error.get("type") in {"mcp", "a2a_preview"} # type: ignore |
| def test_returns_consent_url_for_a2a_preview_source(self) -> None: | ||
| exc = _make_consent_error( | ||
| "https://example.com/a2a-consent", | ||
| name="work-iq", | ||
| source_type="a2a_preview", | ||
| ) | ||
| assert consent_url_from_error(exc) == [ | ||
| ConsentError(name="work-iq", consent_url="https://example.com/a2a-consent") | ||
| ] |
|
LobsterQBA please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Motivation & Context
When a Work IQ tool source returns
CONSENT_REQUIREDwithtype: "a2a_preview", the Foundry Hosting responses server currently ignores the consent URL because it only acceptsmcpsources. This leaves callers without the URL needed to complete consent.Description & Review Guide
consent_url_from_errorto recognize bothmcpanda2a_previewconsent sources, and add a regression test for the latter.Prepared with AI assistance; the change was reviewed and validated locally by the contributor.
Related Issue
Fixes #7227
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.