Skip to content

providers: GitHub Copilot Free lists no models (model_picker_enabled=false drops all; configured models ignored) #56434

Closed as duplicate

Description

@cassianoccs

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

  1. Connect GitHub Copilot via device OAuth on a Copilot Free account. opencode auth list then shows GitHub Copilot GitHub Copilot stored.

  2. Confirm the entitlement from the shell (token from opencode auth export):
    GET https://api.github.com/copilot_internal/user returns 200 with
    {"access_type_sku":"free_limited_copilot","chat_enabled":true,"cli_enabled":true,"copilot_plan":"individual","endpoints":{"api":"https://api.individual.githubcopilot.com",...}}.

  3. GET https://api.githubcopilot.com/models with the stored OAuth access token returns 200 with 52 models. Every model has "model_picker_enabled": false; several have "policy":{"state":"enabled"} (for example gpt-4.1, gpt-4o, gpt-4o-mini).

  4. In OpenCode, open /models (or GET /api/model): there are no github-copilot models at all.

  5. 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/model still shows no github-copilot models.

  6. 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/model returns zero github-copilot models, 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.models makes it appear in GET /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/token returns 403 with an empty body for this account, even with Editor-Version, Editor-Plugin-Version and Copilot-Integration-Id headers, and for both Authorization: Bearer and Authorization: token. If the Copilot model sync depends on that exchange it would fail here. Both https://api.githubcopilot.com/models and https://api.individual.githubcopilot.com/models return 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.log contains no such line and no copilot lines other than cli starting entries, so the sync appears to either never run or fail silently.
  • opencode reload and opencode service restart (with the credential present at boot) do not change the result.
  • The workspace location used for /api/model was 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

  1. opencode-agent commented on Oct 17, 2026

    @opencode-agent
    Contributor

    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 /models stays empty. It has already been reproduced there.

    Possible duplicates and related issues, ordered by likelihood:

    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.

  2. opencode-agent commented on Oct 17, 2026

    @opencode-agent
    Contributor

    Closing as a duplicate of #34644.

    GitHub Copilot Free and Student plans now only allow Auto model selection, so Copilot's /models returns every model with model_picker_enabled: false and OpenCode ends up listing no Copilot models. #34644 tracks adding a github-copilot/auto model for these plans; the fix is in progress in #55960.

    If explicitly configured providers.github-copilot.models entries are still dropped after Auto ships, please open a focused issue for that part.

  3. opencode-agent commented on Oct 18, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #56355. It's the same problem: Copilot Free accounts get every model with model_picker_enabled: false, so github-copilot ends 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions