Python: Forward provider config to SessionConfig in GitHubCopilotAgent (fixes…#5195
Open
Serjbory wants to merge 2 commits intomicrosoft:mainfrom
Open
Python: Forward provider config to SessionConfig in GitHubCopilotAgent (fixes…#5195Serjbory wants to merge 2 commits intomicrosoft:mainfrom
Serjbory wants to merge 2 commits intomicrosoft:mainfrom
Conversation
eavanvalkenburg
approved these changes
Apr 10, 2026
Member
|
@Serjbory please pull in the latest changes and make the updates! |
3f95d5a to
cf9aa04
Compare
Author
@eavanvalkenburg updates are done. Could you review it, please? |
eavanvalkenburg
approved these changes
Apr 10, 2026
Contributor
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.
Fixes #5190
Motivation and Context
GitHubCopilotAgentdoes not forward theproviderfield fromdefault_options(or runtime options) to the Copilot SDK'sSessionConfig/ResumeSessionConfig. This makes BYOK (Bring Your Own Key) and Azure Managed Identity authentication impossible through the Agent Framework wrapper, even though the underlyinggithub-copilot-sdkfully supportsProviderConfigon both config types.Description
Follow the established
mcp_serverspattern to addproviderpassthrough:ProviderConfigfromcopilot.types.GitHubCopilotOptionsTypedDict: Addprovider: ProviderConfigfield with docstring for discoverability and type safety.__init__: Popproviderfrom the options dict and store it asself._provider(same asmcp_servers,on_permission_request, etc.), so it does not leak into_default_options._create_session: Resolveproviderfromruntime_optionsfirst, falling back toself._provider, and forward it toSessionConfig._resume_session: Forwardself._providertoResumeSessionConfig.TestGitHubCopilotAgentProviderclass with 7 tests covering:create_session(Azure +bearer_token)resume_session_default_optionsContribution Checklist