Repository navigation
Description
Foundry Hosting drops the standard Responses approval_request_id relationship when converting a provider MCP call into an outbound response. Clients consequently cannot identify which approval authorized that call.
Observed behavior
Reproduced with agent-framework-core 1.17.0, agent-framework-foundry-hosting 1.0.0b260910 and azure-ai-agentserver-responses 2.2.0b1. The same emission paths were also inspected at commit 0ad2e44.
- The provider MCP call carries
approval_request_idin the original item retained byContent.raw_representation. _OutputItemTracker._open_mcp_callpasses server label, tool name and item ID to the response builder, but omits the approval link.- Hosting generates a new outbound ID for
mcp_approval_requestand stores that ID with the original approval content for incoming decisions. Copying the provider's original approval ID unchanged would therefore be insufficient when the outbound approval has a different ID.
For example: a provider issues approval A, Hosting exposes approval B, and the client approves B. The provider must receive the decision for A. When its subsequent mcp_call refers to A, the outbound call must refer to the corresponding approval B that the client received. Currently that outbound relationship is lost.
Expected behavior
Preserve the explicit approval relationship through incremental events, terminal snapshots, stored history and continuation. Both incoming decisions and outgoing call references must use the appropriate identities for their side of the transport boundary. Do not reconstruct identity from matching names, arguments or output text.
The relationship is defined by the OpenAI Responses MCP contract.
Related SDK change
Azure/azure-sdk-for-python#49037 adds optional approval_request_id support to the MCP builder and preserves it in added/done/terminal output. Hosting still needs to supply the correct outbound approval identity.
Implementation and validation considerations
Confirm whether Hosting should preserve provider IDs or persist an explicit source-to-outbound mapping, including storage scope, collision handling and replay rules. Follow the function-calling loop specification for approval-resume and history changes.
Cover multiple same-name/same-argument approvals, generated outbound IDs, approve/deny, matching call references, restart/replay, and streaming/non-streaming output. This issue concerns existing standard MCP relationships; it does not propose adding a local-function approval field to the protocol.
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
[-]Foundry Hosting: preserve standard MCP approval identity across continuation[/-][+]Python: Foundry Hosting: preserve standard MCP approval identity across continuation[/+]he-yufeng commentedon Sep 17, 2026
I traced this end to end on current main (459fe6e) plus the pinned dependency set, and the drop point is exactly where the report says, with one extra boundary constraint worth naming before anyone picks this up.
Drop point (verified).
_OutputItemTracker._open_mcp_call(python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py:1547) builds the outbound call throughadd_output_item_mcp_call(server_label, name, item_id=...). Nothing downstream of that ever sees an approval link.The builder cannot carry the link today. In
azure-ai-agentserver-responses 2.2.0b1,ResponseEventStream.add_output_item_mcp_call/OutputItemMcpCallBuilderhardcode the emitted item shape to{type: "mcp_call", id, server_label, name, arguments, status}—approval_request_idexists only on the approval response (client decision) path, not on the call path. This matters for fix shape: patching the incremental event dicts in hosting would leave the terminal snapshot stale, because the stream records items internally as they are emitted and assemblesresponse.completedfrom that record. The report's own requirement (incremental events AND terminal snapshots AND stored history) rules out the dict-patching route.Where the correlation data already lives. On approval emission (
_responses.py:1404-1421) hosting savesB -> function_approval_request contentin approval storage, so the B side is recoverable. The provider's A arrives on the raw provider item; coreContent.from_mcp_server_tool_callhas no dedicated field for it, butadditional_propertiesis the preservation channel that survives history serialization (raw_representation does not).Fix shape I'd propose, two-sided:
azure-ai-agentserver-responses:add_output_item_mcp_call/ the builder acceptapproval_request_idand plumb it into every emitted item (added, arguments done, completed, done), so the internal record and all snapshots stay consistent.mcp_callitems intoContentpreservesapproval_request_idintoadditional_properties, so history and continuation round-trip it.A -> B(the provider id read off the approval content's raw representation);_open_mcp_callresolves the call's provider-side A to the client-side B and passes B outbound.Happy to implement the core + hosting side with regression tests. The one decision I need from the team: does the agentserver builder param land first (bump the floor here after), or would you rather hosting construct the
mcp_callevents without the builder in the meantime? The first keeps one writer for item shape; the second duplicates builder logic in hosting.github-actions commentedon Sep 18, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
The bug reproduces in
python/packages/foundry_hosting/agent_framework_foundry_hosting/_responses.py::_OutputItemTracker._open_mcp_callwhen an MCP call references provider approval A after Hosting emitted and stored client-facing approval B. The outboundmcp_calllacksapproval_request_id. Minimal repro: emit a function approval request through the tracker, capture generated ID B, then emit an MCP call whose raw representation references A and assert its outbound item references B.python/packages/foundry_hosting/tests/test_responses.py1.0.0b2609101.0.0b260910eavanvalkenburg commentedon Oct 27, 2026
/plan Investigate the smallest correct Python hosted MCP approval-identity fix on current main, coordinating with owner Eduard van Valkenburg (@eavanvalkenburg) and volunteer Yufeng He (@he-yufeng) before implementation assignment. This is preservation of the existing standard MCP approval relationship, not a new local-function approval protocol. Hosting currently stores client-facing approval B with the original content but omits approval_request_id when building outbound mcp_call; provider-side A and client-facing B must remain explicitly correlated across continuation. Respect the stable occurrence identity and content metadata contracts from #8886 and docs/specs/004-python-function-calling-loop.md. Define the durable source-to-outbound identity representation, scope, collision/replay handling and restart/serialization behavior; never infer authority from equal names, arguments or output text, and do not depend on nonserialized raw_representation. Azure/azure-sdk-for-python#49037 is still OPEN, not merged or released: verify builder support and the eventual official dependency floor before claiming availability or bumping requirements. Prefer one authoritative SDK item builder and evaluate dependency-first sequencing rather than patching emitted dicts while terminal snapshots remain stale or duplicating the protocol writer. Compare preserving provider IDs with a scoped persisted alias mapping, accounting for generated IDs and incoming approve/deny decisions. Plan fake-provider streaming/nonstreaming tests covering added/done/terminal output, stored history, same-name/same-argument approvals, collision/mismatch rejection, replay, continuation and serialized restart. The .NET counterpart #8873 is merged but does not establish a Python fix; coordinate parity manually. Report minimal production scope, upstream blockers, compatibility/storage choices and focused test commands before implementation. This is nonminor correctness planning, not implementation approval or a ready-for-implementation decision.