github / github/app

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

Open
#1,131 2 comments 1 reaction 0 assignees View on GitHub
Bugs
Dominant language
No language data
Stars
2.1k
Forks
153
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

Open the contributing guide

Research direction

Locate the desktop app's OAuth flow and its scope list, then compare sign-in behavior for github.com and GHEC Data Residency hosts. Verify completion by reproducing the issue on a *.ghe.com account and confirming that the model picker exposes available models and chat requests succeed without the workaround in ~/.copilot/data.db.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, macos, sqlite
Domain
authentication, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.