github / github/copilot-cli

Copilot CLI incorrectly infers repository owner, ignoring git remote configuration

Đang mở
#1,178 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:enterprise
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 bug

Copilot CLI incorrectly infers the repository owner/organization, even when the git remote is correctly configured.

In my case, the remote is set to a private GitHub Enterprise (GHE/EMU) organization, but Copilot CLI infers a different owner instead.

### Affected version



### Steps to reproduce

1. Clone a repository from a private GHE/EMU organization (e.g., `git clone git@github.com:MyEnterpriseOrg/my-repo.git`)
2. Verify the remote is correct: `git remote get-url origin` shows the correct enterprise org
3. Run a Copilot CLI command that references the repository, e.g.:
copilot -p "Show me this week's commits and summarize them" --allow-tool 'shell(git)'
4. Observe that Copilot infers a different/wrong owner

### Expected behavior

Copilot CLI should parse the git remote URL and correctly identify the owner from the configured remote.

### Actual behavior

Copilot CLI infers a different owner, possibly due to:
- Hardcoded defaults or legacy config
- Incorrect parsing of the remote URL or directory structure
- Internal cache or mapping that doesn't update when changing directories/remotes
- Issue specific to GHE/EMU organization handling

### Related issues

- #1167 - Similar issue where session selection uses branch name only, not full repository identity

### Additional context

- Repository is in a **private GitHub Enterprise (EMU) organization**
- This may be related to session caching or how the CLI resolves enterprise vs non-enterprise orgs

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

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

Đánh giá

Issue này chưa được đánh giá.

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.