github / github/app

GitHub Copilot App v1.0.0: model_not_supported on GHEC Data Residency — OAuth token missing copilot scope

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

The GitHub Copilot App v1.0.0 fails to work on GHEC Data Residency instances (e.g. *.ghe.com). The model picker shows only "Auto" and all chat requests fail with CAPIError: 400 model_not_supported.

### Affected version or release

v1.0.0

### Installation context

_No response_

### What happened?

Description

The GitHub Copilot App v1.0.0 fails to work on GHEC Data Residency instances (e.g. *.ghe.com). The model picker shows only "Auto" and all chat requests fail with CAPIError: 400 model_not_supported.

Environment

- GitHub Copilot App v1.0.0 (macOS, aarch64)
- Bundled CLI v1.0.63
- GHEC DR instance with Copilot Business ( all features enabled)


Root Cause

The desktop app's OAuth flow does not request the copilot scope. On github.com this works because the Copilot API grants full model access without it. On GHEC DR, the copilot scope is required.

Without the copilot scope, the Copilot API on GHEC DR returns only 4 legacy models:

["gpt-4o-mini-2024-07-18", "gpt-3.5-turbo-0613", "gpt-3.5-turbo", "gpt-4o-mini"]

With the copilot scope (e.g. via gh CLI token), the same user gets 18 models including all current ones.


Verified by extracting the app's token from ~/.copilot/data.db (github_accounts table) and testing both tokens with curl against the GHEC DR Copilot API.

### Steps to reproduce

1. Install GitHub Copilot App v1.0.0
2. Sign in with a GHEC Data Residency account (*.ghe.com)
3. Open a new chat session
4. Send any message

### Expected behavior

Expected: Model picker shows available models, chat responds normally.
Actual: Model picker shows only "Auto". Chat fails with:

CAPIError: 400 The requested model is not supported.
code: "model_not_supported"
param: "model"
type: "invalid_request_error"

### Additional context

Suggested Fix

Add copilot to the OAuth scope list in the desktop app's auth flow, at minimum for non-github.com hosts.

Workaround

Users can replace the app's stored token with a gh CLI token that has the copilot scope:

# 1. Quit the Copilot App (Cmd+Q)
# 2. Authenticate gh CLI with copilot scope
gh auth login -h your_host.ghe.com -s copilot,repo,read:org,user,gist
# 3. Replace the app's token
TOKEN=$(gh auth token -h your_host.ghe.com)
sqlite3 ~/.copilot/data.db \
"UPDATE github_accounts SET access_token='$TOKEN' WHERE host='your_host.ghe.com';"
# 4. Reopen the Copilot App

Note: Signing out/in from the app will revert the fix since the app will re-authenticate without the copilot scope.

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

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

Hướng nghiên cứu

Xác định luồng OAuth của ứng dụng desktop và danh sách scope của luồng đó, sau đó so sánh hành vi đăng nhập đối với các host github.com và GHEC Data Residency. Xác minh đã hoàn tất bằng cách tái hiện vấn đề trên một tài khoản *.ghe.com và xác nhận rằng trình chọn model hiển thị các model khả dụng, đồng thời các yêu cầu chat thành công mà không cần workaround trong ~/.copilot/data.db.

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, macos, sqlite
Lĩnh vực
authentication, desktop
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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
48/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.