Python: emit oauth_consent_request in hosting _to_outputs() (fixes #5535)#6200
Open
hanhan761 wants to merge 3 commits into
Open
Python: emit oauth_consent_request in hosting _to_outputs() (fixes #5535)#6200hanhan761 wants to merge 3 commits into
hanhan761 wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add handling for
oauth_consent_requestcontent 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
elifbranch in_to_outputs()forcontent.type == oauth_consent_requestthat emits the consent link as a message SSE event viaaoutput_item_message. This mirrors the handling pattern used by other content types in the same function.The
function_approval_requestcontent 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 surfacesoauth_consent_requestcontent 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: