github / github/copilot-cli

Copilot CLI incorrectly selects the wrong authenticated GitHub account when pushing commits

Aberta
#3,897 0 comentários 0 reações 0 responsáveis Ver no GitHub
area:authentication
Linguagem predominante
Shell
Estrelas
11.2k
Forks
1.9k
Merge médio
14h 16min
PRs com merge (30d)
6

Descrição

### 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.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start by reproducing the commit-and-push workflow with multiple authenticated accounts, then compare the /user switch behavior with the gh auth switch command. Define how insufficient-permission failures should trigger confirmation, account selection, and retry. Done means the correct identity can be selected inline without manual account switching.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
git, github, shell
Domínio
authentication, authorization, cli
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.