Skip to content

Support concurrent usage of multiple GitHub accounts for child extensions (#317821)#319166

Open
Neizan93 wants to merge 2 commits into
microsoft:mainfrom
Neizan93:feature/concurrent-github-accounts-317821
Open

Support concurrent usage of multiple GitHub accounts for child extensions (#317821)#319166
Neizan93 wants to merge 2 commits into
microsoft:mainfrom
Neizan93:feature/concurrent-github-accounts-317821

Conversation

@Neizan93
Copy link
Copy Markdown

@Neizan93 Neizan93 commented May 30, 2026

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 (AuthenticationExtensionsService and AuthenticationMcpService).

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:

  1. Hierarchical Storage (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.
  2. Default Inheritance (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.
  3. Event Scoping: When a preference is updated, change events are fired specifically for the child extension if it is a child, or for both the parent and its children if it's the parent.

An identical update is applied to the parallel AuthenticationMcpService class to support the same hierarchical behavior for MCP servers.


Copilot AI review requested due to automatic review settings May 30, 2026 20:24
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented May 30, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@TylerLeonhardt

Matched files:

  • src/vs/workbench/services/authentication/browser/authenticationExtensionsService.ts
  • src/vs/workbench/services/authentication/browser/authenticationMcpService.ts
  • src/vs/workbench/services/authentication/test/browser/authenticationExtensionsService.test.ts
  • src/vs/workbench/services/authentication/test/browser/authenticationMcpService.test.ts

@Neizan93 Neizan93 force-pushed the feature/concurrent-github-accounts-317821 branch from 76d3e2b to 0e9fa85 Compare May 30, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants