github / github/app

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

Ouverte
#1,131 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Bugs
Langage dominant
Aucune donnée de langage
Étoiles
2.1k
Forks
153
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Localiser le flux OAuth de l’application de bureau et sa liste de scopes, puis comparer le comportement de connexion pour les hôtes github.com et GHEC Data Residency. Vérifier que c’est terminé en reproduisant le problème avec un compte *.ghe.com et en confirmant que le sélecteur de modèles expose les modèles disponibles et que les requêtes de chat réussissent sans le workaround dans ~/.copilot/data.db.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
github, macos, sqlite
Domaine
authentication, desktop
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.