Skip to content

Python: emit oauth_consent_request in hosting _to_outputs() (fixes #5535)#6200

Open
hanhan761 wants to merge 3 commits into
microsoft:mainfrom
hanhan761:fix-5535-oauth-consent-hosting
Open

Python: emit oauth_consent_request in hosting _to_outputs() (fixes #5535)#6200
hanhan761 wants to merge 3 commits into
microsoft:mainfrom
hanhan761:fix-5535-oauth-consent-hosting

Conversation

@hanhan761
Copy link
Copy Markdown

Summary

Add handling for oauth_consent_request content type in the hosting layer's _to_outputs() function so that OAuth consent links from toolbox MCP connectors are properly emitted as SSE events instead of being silently dropped.

Issue

Fixes #5535

Changes

Added an elif branch in _to_outputs() for content.type == oauth_consent_request that emits the consent link as a message SSE event via aoutput_item_message. This mirrors the handling pattern used by other content types in the same function.

The function_approval_request content type was already handled in a previous change.

Background

When a ResponsesHostServer-hosted agent uses a Foundry toolbox with an OAuth-protected MCP connector, the agent framework surfaces oauth_consent_request content from the streaming parser. However, _to_outputs() in the hosting layer had no handler for this content type, causing the consent link to be dropped with only a warning log:

WARNING: Content type 'oauth_consent_request' is not supported yet.

Copilot AI review requested due to automatic review settings May 30, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: ResponsesHostServer drops oauth_consent_request and function_approval_request from toolbox MCP connectors

2 participants