github / github/app

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

オープン
#1,131 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
Bugs
主要言語
言語のデータがありません
スター
2.1k
フォーク
153
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

デスクトップアプリの OAuth フローとその scope リストを特定し、github.com と GHEC Data Residency のホストでのサインイン動作を比較します。*.ghe.com アカウントで問題を再現し、モデルピッカーに利用可能なモデルが表示され、~/.copilot/data.db の workaround なしでチャットリクエストが成功することを確認して、完了を検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github, macos, sqlite
領域
authentication, desktop
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。