github / github/copilot-cli

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

Abierto
#3,897 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:authentication
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza reproduciendo el flujo de trabajo de commit y push con varias cuentas autenticadas y, después, compara el comportamiento del cambio de /user con el comando gh auth switch. Define cómo los fallos por permisos insuficientes deben activar la confirmación, la selección de cuenta y el reintento. Se considera terminado cuando se puede seleccionar la identidad correcta inline sin cambiar manualmente de cuenta.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, github, shell
Área
authentication, authorization, cli
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.