Repository navigation
providers: GitHub Copilot Free lists no models (model_picker_enabled=false drops all; configured models ignored) #56434
Description
Summary
With a connected GitHub Copilot Free account, OpenCode v2.0.27 lists zero Copilot models, so every model reference fails with Model unavailable: github-copilot/<model>. The same models work when called directly against the Copilot API with the stored credential. Explicitly declaring the models under providers.github-copilot.models does not help.
Environment
- opencode version: v2.0.27
- OS: Windows 10.0.19045.6811 (win32 x64)
- Terminal: Unavailable: terminal environment variables are not set
- Shell: PowerShell (powershell.exe) / cmd.exe
- Install/channel: latest
- Active plugins: opencode-models-discovery 1.10.0
Reproduction
-
Connect GitHub Copilot via device OAuth on a Copilot Free account.
opencode auth listthen showsGitHub Copilot GitHub Copilot stored. -
Confirm the entitlement from the shell (token from
opencode auth export):
GET https://api.github.com/copilot_internal/userreturns 200 with
{"access_type_sku":"free_limited_copilot","chat_enabled":true,"cli_enabled":true,"copilot_plan":"individual","endpoints":{"api":"https://api.individual.githubcopilot.com",...}}. -
GET https://api.githubcopilot.com/modelswith the stored OAuth access token returns 200 with 52 models. Every model has"model_picker_enabled": false; several have"policy":{"state":"enabled"}(for examplegpt-4.1,gpt-4o,gpt-4o-mini). -
In OpenCode, open
/models(orGET /api/model): there are nogithub-copilotmodels at all. -
Add the models to the global config anyway:
{ "providers": { "github-copilot": { "models": { "gpt-4.1": { "name": "GPT-4.1 (Copilot Free)" }, "gpt-4o": { "name": "GPT-4o (Copilot Free)" } } } } }Reload and restart (the latter also with
opencode service restart).GET /api/modelstill shows nogithub-copilotmodels. -
opencode run --model github-copilot/gpt-4.1 "..."fails with:Error: Model unavailable: github-copilot/gpt-4.1
Expected Behavior
Models the account can actually use (gpt-4.1, gpt-4o, gpt-4o-mini) appear in /models, and/or models explicitly declared under providers.github-copilot.models are kept and selectable. The providers guide states that models "add or override" a provider's models.
Actual Behavior
GET /api/modelreturns zerogithub-copilotmodels, while other providers return their models.- Config-declared Copilot models are silently discarded.
Model unavailable: github-copilot/gpt-4.1. - The same config mechanism works for another catalog provider: adding a model under
providers.groq.modelsmakes it appear inGET /api/model, so config parsing/merging is not the problem.
The Copilot provider is reachable:
GET /api/provider/github-copilot
=> activation: "enabled"
package: "@opencode/ai/providers/openai-compatible"
settings: { "baseURL": "https://api.githubcopilot.com" }
(no models)
Chat completions succeed directly with the stored credential:
POST https://api.githubcopilot.com/chat/completions
Authorization: Bearer <stored token>
{"model":"gpt-4.1","messages":[{"role":"user","content":"ok?"}]}
=> 200 {"choices":[{"message":{"content":"ok",...}}]}
gpt-4o and gpt-4o-mini also return 200. gpt-4.1-2025-04-14 returns 200. Other policy.state=enabled models (gpt-5.6-luna, gpt-6-luna, mai-code-1.1-flash, claude-haiku-4.5) return 400 model_not_supported on the account.
Additional Context
GET https://api.github.com/copilot_internal/v2/tokenreturns 403 with an empty body for this account, even withEditor-Version,Editor-Plugin-VersionandCopilot-Integration-Idheaders, and for bothAuthorization: BearerandAuthorization: token. If the Copilot model sync depends on that exchange it would fail here. Bothhttps://api.githubcopilot.com/modelsandhttps://api.individual.githubcopilot.com/modelsreturn 200 with the stored token directly.- The docs say a failed sync is logged as
failed to sync GitHub Copilot models.~/.local/share/opencode/log/opencode.logcontains no such line and nocopilotlines other thancli startingentries, so the sync appears to either never run or fail silently. opencode reloadandopencode service restart(with the credential present at boot) do not change the result.- The workspace location used for
/api/modelwas the project directory; the Copilot credential is global. - Workaround tried: none worked. The account's entitlement and the Copilot API itself are fine.
Possible root cause: OpenCode filters Copilot models by model_picker_enabled, which GitHub sets to false for Copilot Free accounts, and the Copilot discovery path then replaces the provider's model map instead of merging configured models into it.
Activity
opencode-agent commentedon Oct 17, 2026
Thanks for the detailed report and the API checks. I think this is a duplicate of #56355: a Copilot Free account where every model comes back with
model_picker_enabled: false, so OpenCode marks them all as disabled and/modelsstays empty. It has already been reproduced there.Possible duplicates and related issues, ordered by likelihood:
enabledis taken frommodel_picker_enabled, so the provider shows zero models (reproduced).providers.github-copilot.modelsare silently dropped unless the ID is in the bundled catalog. This matches the second part of your report.model_picker_enabled: false#42083: the samemodel_picker_enabled: falsecause, reported against v1 (closed).The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Please add any extra details, such as the config-declared models being ignored, to #56355 or #52983.
opencode-agent commentedon Oct 17, 2026
Closing as a duplicate of #34644.
GitHub Copilot Free and Student plans now only allow Auto model selection, so Copilot's
/modelsreturns every model withmodel_picker_enabled: falseand OpenCode ends up listing no Copilot models. #34644 tracks adding agithub-copilot/automodel for these plans; the fix is in progress in #55960.If explicitly configured
providers.github-copilot.modelsentries are still dropped after Auto ships, please open a focused issue for that part.opencode-agent commentedon Oct 18, 2026
Closing this as a duplicate of #56355. It's the same problem: Copilot Free accounts get every model with
model_picker_enabled: false, sogithub-copilotends up with no models. It has already been reproduced there. We didn't hear back about how this report differs, so please follow #56355 for updates. For config-declared Copilot models being dropped, see #52983. If your problem turns out to be different, reply here and we'll take another look. Thanks for the detailed report!