[Bug] Copilot-internal endpoints hardcoded to api.github.com fail (403/404) for GHE.com data-residency subscriptions
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 2.1k
- Fork
- 153
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### Short summary
Internal Copilot endpoints are hardcoded to api.github.com and fail (403/404) when the Copilot subscription lives on a GHE.com data-residency account
### Affected version or release
1.1.6 (commit a9706b2)
### Installation context
Windows 11 x64. Primary account: GHE.com data residency (`9altitudes.ghe.com`) holding the Copilot subscription. Secondary github.com account added, no Copilot license.
### What happened?
Several app features call Copilot-internal endpoints on `api.github.com` regardless of which host holds the Copilot subscription:
```
github_app::github::repos: copilot repo search returned error
url=https://api.github.com/copilot_internal/repository_search status=404 Not Found
github_app::github::client: github API request failed status=403
url=https://api.github.com/cmc_internal/api/agents/automations/triggers
error=GitHub API request failed (403 Forbidden): This API requires a valid Copilot license.
```
Because my Copilot license is on the GHE.com tenant (not on the github.com account), these calls fail on every app start: repository search 404s and cloud workflow/automations metadata 403s ("requires a valid Copilot license"). The features backing them silently degrade for data-residency customers.
### Steps to reproduce
1. Have your Copilot subscription on a GHE.com data-residency account; add it to the app (optionally also a github.com account without a Copilot seat).
2. Start the app and watch `~/.copilot/logs/github-app..log`.
3. Observe 404 on `api.github.com/copilot_internal/repository_search` and 403 on `api.github.com/cmc_internal/api/agents/automations/*`.
### Expected behavior
Copilot-internal endpoints should be resolved against the host/tenant that holds the Copilot subscription (or the data-residency equivalent), not hardcoded to api.github.com.
### Additional context
- Request ID example: `D49F:1D5EDB:4C4B17F:49B7142:6A76E1CA` (403, cmc_internal/api/agents/automations/tools)
- Companion issue about unauthenticated calls to the GHE.com API itself: #2716
- Related: #1131 (GHEC data residency OAuth scope)
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện các lỗi request trong ~/.copilot/logs/github-app..log và theo dõi các lệnh gọi đến /copilot_internal/repository_search và /cmc_internal/api/agents/automations/*; issue không nêu tên tệp mã nguồn hoặc test nào. Được xem là hoàn tất khi các endpoint này sử dụng host hoặc tenant đang giữ gói đăng ký Copilot, bao gồm cả trường hợp data residency của GHE.com, mà không còn các lỗi 403/404 đã báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- github
- Lĩnh vực
- api, backend
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- 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