You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Offer account preferences when repository access may use the wrong account - #9127
Users signed in with multiple GitHub accounts can encounter repository-access failures when the workspace uses the wrong account, without clear guidance on switching accounts.
Account guidance: On a non-SAML repository 404, detect multiple signed-in accounts and offer a modal that opens account preferences scoped to this extension and authentication provider.
Prompt safeguards: Show at most once per provider per window, without blocking repository discovery. Preserve existing SAML and transient-error handling, and skip UI after disposal.
CopilotAI
changed the title
[WIP] Detect if the user has multiple accounts in VSCode Insider
Offer account preferences when repository access may use the wrong account
Oct 29, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The account-preferences warning is non-modal, can consume the one-time offer after a repository closes, and appears for environment-token credentials that account switching cannot change.
Adds account-switching guidance for workspace repository-access failures, helping users signed into multiple GitHub accounts identify a possible account mismatch.
Changes:
Offers extension-scoped account preferences after inaccessible workspace remotes are detected.
Adds GitHub.com-only prompting with duplicate suppression, disposal checks, and error handling.
Tests prompt behavior and repository discovery, including missing template repositories.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The account-preferences prompt is non-modal and can appear after its repository folder closes, consuming the window’s one-time guidance.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Cancel account prompts when the repository closes
src/github/folderRepositoryManager.ts:615
If the folder closes while authentication.getAccounts() is pending, the shared CredentialStore remains alive, so this guard still allows a warning for the closed repository and consumes the window's one-time prompt. Pass a folder-lifetime cancellation token or validity callback to the helper, and recheck it after account lookup before setting the offered flag, and before opening preferences. Add a regression test that closes the folder while account lookup is pending.
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
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.
Users signed in with multiple GitHub accounts can encounter repository-access failures when the workspace uses the wrong account, without clear guidance on switching accounts.