github / github/copilot-cli

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

Đang mở
#3,897 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:authentication
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git, github, shell
Lĩnh vực
authentication, authorization, cli
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.