Copilot CLI incorrectly selects the wrong authenticated GitHub account when pushing commits
- Langage dominant
- Shell
- Étoiles
- 11.2k
- Forks
- 1.9k
- Merge moyen
- 14 h 16 min
- PR mergées (30 j)
- 6
Description
### Describe the feature or problem you'd like to solve
Copilot CLI becomes confused when multiple GitHub accounts are authenticated (e.g., EMU + personal GitHub) and attempts to push using the wrong identity, causing 403 push failures until I manually run gh auth switch
### Proposed solution
Copilot CLI should automatically detect when a push fails due to insufficient permissions on the active account, then prompt the user to confirm an account switch inline, and retry the push using the correct authenticated identity, without requiring a manual gh auth switch command.
The /user switch doesn't recognize EMU accounts
### Example prompts or workflows
Prompt:
“Commit and push my changes.”
### Additional context
I regularly use two authenticated GitHub accounts in my daily workflow:
- GitHub EMU (corporate)
- GitHub.com personal (under Microsoft org)
Copilot CLI currently:
- Commits locally
- Attempts to push using the wrong account
- Fails with: “mmansour_microsoft does not have permission to push to microsoft/webui.git (403)”
- Detects another authenticated account but refuses to switch without manual intervention
- Requires me to run gh auth switch manually every time
This breaks the flow of “commit + push” automation and makes Copilot feel unreliable in multi‑identity setups.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire le workflow de commit et de push avec plusieurs comptes authentifiés, puis comparez le comportement du changement de /user avec la commande gh auth switch. Définissez comment les échecs dus à des permissions insuffisantes doivent déclencher la confirmation, la sélection du compte et une nouvelle tentative. C’est terminé lorsque la bonne identité peut être sélectionnée inline sans changer manuellement de compte.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- git, github, shell
- Domaine
- authentication, authorization, cli
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100