Support concurrent usage of multiple GitHub accounts for child extensions (#317821)#319166
Open
Neizan93 wants to merge 2 commits into
Open
Support concurrent usage of multiple GitHub accounts for child extensions (#317821)#319166Neizan93 wants to merge 2 commits into
Neizan93 wants to merge 2 commits into
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @TylerLeonhardtMatched files:
|
76d3e2b to
0e9fa85
Compare
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 of Proposed Changes
This PR addresses issue #317821 by introducing a hierarchical preference lookup and storage system in VS Code's workbench authentication services (
AuthenticationExtensionsServiceandAuthenticationMcpService).Currently, child extensions (e.g., GitHub Copilot) inherit their GitHub account preference from their parent extension (e.g., Git / GitHub Authentication). However, when selecting or changing an account for Copilot, the selection would overwrite the parent preference key. This made it impossible to concurrently use Account A for Git and Account B for Copilot in the same workspace.
To resolve this:
updateAccountPreference/removeAccountPreference): Preferences are now written and removed using the specific child extension's ID key (e.g.,github.copilot-github) instead of resolving directly to the parent's key. This keeps their preferences isolated.getAccountPreference): When looking up account preferences, the service first checks for the specific extension's own ID. If not found, it falls back to the parent extension's key. This preserves the status quo and backward compatibility for single-account setups.An identical update is applied to the parallel
AuthenticationMcpServiceclass to support the same hierarchical behavior for MCP servers.