Skip to content

GitHub Copilot provider shows zero models: all models return model_picker_enabled: false #42083

Closed as not planned

Description

@Keylessboi

Summary

On opencode 1.18.15 (Arch package), the github-copilot provider never appears in the model picker. opencode auth login -p github-copilot works (auth succeeds), but opencode models github-copilot returns "Provider not found", and /models in the TUI shows no Copilot models.

Root cause

In packages/opencode/src/plugin/github-copilot/copilot.ts, the models() hook returns only models where result.pickerEnabled.has(model.api.id):

return CopilotModels.get(...)
  .then((result) => {
    models = result.models
    return Object.fromEntries(
      Object.entries(result.models).filter(([, model]) => result.pickerEnabled.has(model.api.id)),
    )
  })

pickerEnabled (built in models.ts:257) is the set of models with model_picker_enabled: true in the API response:

pickerEnabled: new Set([...remote].filter(([, item]) => item.model_picker_enabled).map(([id]) => id)),

GitHub's GET https://api.githubcopilot.com/models currently returns model_picker_enabled: false for every single model — even ones that are policy.state: "enabled" and fully usable. So pickerEnabled is always empty, the filter drops everything, and the provider surfaces zero models.

Evidence

Using a valid, freshly-authenticated Copilot OAuth token (device flow, client_id=Ov23li8tweQw6odWQebz):

HTTP 200, total models: 47
policy states:  disabled: 18 | none: 23 (internal: copilot-search-*, exec-agent-*) | enabled: 6
model_picker_enabled=true: 0

The 6 policy.state: "enabled" models (gpt-4o, gpt-5-mini, claude-haiku-4.5, gpt-4.1, mai-code-1-flash, mai-code-1.1-flash) pass the existing usable() check (models.ts:207), and chat completions against them work fine:

POST https://api.githubcopilot.com/chat/completions → 200, "Hi there! ..."

So the account/subscription is fine — the filter is the problem. Note: exchanging the OAuth token for a Copilot session token via api.github.com/copilot_internal/v2/token and using that against /models returns 403, so the session-token route is not a workaround either.

Suggested fix

Filter by the already-existing usable() predicate (policy.state !== "disabled" + has max_output_tokens/max_prompt_tokens + has tool_calls) instead of, or in addition to, model_picker_enabled. Either:

  • Return result.models (already filtered by usable() inside CopilotModels.get) without the pickerEnabled filter, or
  • Union pickerEnabled with the usable set.

model_picker_enabled appears to be a deprecated/no-longer-reliable signal from GitHub's API.

Workaround

A local plugin overriding the provider's models() hook to return all usable models (same usable() criteria, no picker filter) restores all 25 available Copilot models:

// ~/.config/opencode/plugins/copilot-picker-fix.js
export const CopilotPickerFix = async () => ({
  provider: {
    id: "github-copilot",
    async models(provider, ctx) {
      if (ctx.auth?.type !== "oauth") return provider.models
      const base = ctx.auth.enterpriseUrl
        ? `https://copilot-api.${ctx.auth.enterpriseUrl.replace(/^https?:\/\//, "").replace(/\/$/, "")}`
        : "https://api.githubcopilot.com"
      const r = await fetch(`${base}/models`, {
        headers: { Authorization: `Bearer ${ctx.auth.refresh}`, "User-Agent": "opencode/1.18.15", "X-GitHub-Api-Version": "2026-06-01" },
        signal: AbortSignal.timeout(5000),
      })
      if (!r.ok) return provider.models
      const j = await r.json()
      const models = {}
      for (const m of j.data || []) {
        if (m.policy?.state === "disabled") continue
        const lim = m.capabilities?.limits
        if (!lim?.max_output_tokens || !lim?.max_prompt_tokens) continue
        if (m.capabilities?.supports?.tool_calls === undefined) continue
        const isMsg = m.supported_endpoints?.includes("/v1/messages")
        models[m.id] = {
          id: m.id, providerID: "github-copilot",
          api: { id: m.id, url: isMsg ? `${base}/v1` : base, npm: isMsg ? "@ai-sdk/anthropic" : "@ai-sdk/github-copilot" },
          status: "active",
          limit: { context: lim.max_context_window_tokens ?? lim.max_prompt_tokens, input: lim.max_prompt_tokens, output: lim.max_output_tokens },
          capabilities: { temperature: true, reasoning: true, attachment: true, toolcall: m.capabilities.supports.tool_calls, input: { text: true, audio: false, image: !!m.capabilities.supports.vision, video: false, pdf: false }, output: { text: true, audio: false, image: false, video: false, pdf: false }, interleaved: false },
          family: m.capabilities.family, name: m.name, cost: { input: 0, output: 0, cache: { read: 0, write: 0 } }, options: {}, headers: {},
          release_date: m.version.startsWith(`${m.id}-`) ? m.version.slice(m.id.length + 1) : m.version,
        }
      }
      return models
    },
  },
})

Environment

  • opencode 1.18.15-1 (Arch Linux package)
  • GitHub Copilot subscription: active (chat completions return 200)
  • OAuth apps tested: opencode's own (Ov23li8tweQw6odWQebz) and the VSCode Copilot app (Iv1.b507a08c87ecfe98) — same result either way

Activity

  1. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues with similar symptoms. Please check:

    Your root-cause analysis (all models returning model_picker_enabled: false from GitHub's API) is a distinct and well-evidenced finding. If the maintainers confirm this is a separate underlying cause, it warrants its own fix. It may also explain some of the symptoms reported in the issues above.

  2. Keylessboi commented on Aug 12, 2026

    @Keylessboi
    Author

    Related issues

    This appears to be the root cause behind several similar reports:

    The common thread: auth succeeds, opencode providers list shows the credential, but opencode models github-copilot → "Provider not found" and the picker is empty.

    This issue documents the actual root cause (all models return model_picker_enabled: false, so the pickerEnabled filter empties the list) with raw API evidence and a working local-plugin workaround. If the maintainers want to consolidate, this is the issue with the diagnosis.

  3. Keylessboi commented on Aug 12, 2026

    @Keylessboi
    Author

    Additional related issues surfaced by a preflight search (both closed, but relevant):

    These closed reports describe the same symptom. This issue (42083) documents the root cause (model_picker_enabled returning false for all models) plus a working workaround.

  4. rekram1-node commented on Aug 13, 2026

    @rekram1-node
    Contributor

    Hm I'm completely unable to reproduce, are you by any chance using a business account?

  5. miju04 commented on Aug 13, 2026

    @miju04

    I've encountered this exact same issue with my private GitHub student license, where no models appear even though I am authenticated. Interestingly, with my Copilot license through work, I don’t experience this problem at all, and models are listed correctly.
    This leads me to believe that the difference might be tied to how different Copilot licenses apply restrictions, especially with features like the model picker. It seems that student licenses might handle model availability differently or have inconsistencies in how permissions are reflected.

  6. rekram1-node commented on Aug 14, 2026

    @rekram1-node
    Contributor

    hhm what models do u have enabled in other clients then? Just the auto model??

  7. miju04 commented on Aug 14, 2026

    @miju04

    Ah yes, i did that. And this seems to be the only correct way for github student, i just found this community post update about the student license only be able to work with the auto model picker.

  8. Keylessboi commented on Aug 14, 2026

    @Keylessboi
    Author

    Yes I use auto, I also have a github student account. I apologize for the long check in.

  9. alexmatiasas commented on Sep 7, 2026

    @alexmatiasas

    I've encountered this exact same issue with my private GitHub student license, where no models appear even though I am authenticated. Interestingly, with my Copilot license through work, I don’t experience this problem at all, and models are listed correctly.
    This leads me to believe that the difference might be tied to how different Copilot licenses apply restrictions, especially with features like the model picker. It seems that student licenses might handle model availability differently or have inconsistencies in how permissions are reflected.

    So am I, I'm using the free version of Gh copilot though, I was asking claude, wth, man? And here I am, looks like it needs to be hardcoded in the opencode.json configuration, seems like a patch, but I decided to use alternatives like Gemini or Groq that works around the issue, even with free accounts

  10. pipounix commented on Oct 11, 2026

    @pipounix

    Confirming this persists on opencode v2.0.26 (latest channel, Windows) with a GitHub Copilot Free (free_limited_copilot) account, and adding the V2 code path.

    Symptom

    OAuth device flow succeeds (opencode auth list shows an active GitHub Copilot credential) and the provider is registered (GET /api/provider → github-copilot, activation: auto), but opencode models lists zero github-copilot/* models and opencode run --model github-copilot/gpt-4.1 returns Model unavailable.

    Root cause (V2)

    In the bundled GitHub Copilot plugin, the per-model registry entry takes enabled straight from GitHub's picker field:

    // per-model builder
    status: "active", enabled: a.model_picker_enabled, /* ... */

    and the sync helper additionally applies a usable()-style filter (policy.state !== "disabled", limits, tool_calls):

    async function gQ(e, a) {
      let i = await fetch(`${e}/models`, {
        headers: a,
        signal: AbortSignal.timeout(5000),
      });
      /* ... */
    }

    GitHub's GET https://api.githubcopilot.com/models returns model_picker_enabled: false for every model on this account, so every synced model is registered as enabled: false (and the models that survive the usable() filter are hidden/disabled). Nothing is selectable, even though many of those models are fully callable.

    Account/API evidence (token redacted)

    • total models returned: 50; model_picker_enabled: true: 0; policy.state → disabled: 19, (unset): 23, enabled: 8
    • Direct POST /chat/completions → 200 for gpt-4.1, gpt-4o, gpt-4o-mini, gpt-4.1-2025-04-14, gpt-4o-* / gpt-4o-mini-* dated snapshots
    • Same endpoint → 400 model_not_supported for gpt-5-mini, kimi-k3, claude-haiku-4.5, gpt-5.4, gpt-6-*, etc.

    So, as noted in this issue, model_picker_enabled is not a reliable "usable" signal: the account works fine, the picker field is just false (free/student licenses appear to always report false). The registry enabled flag should instead derive from the usable predicate policy.state + limits + tool_calls, or the picker field should not gate registration at all.

    Separately, the sync uses AbortSignal.timeout(5000). On slower networks this aborts and logs failed to sync GitHub Copilot models (TimeoutError), matching the reports in #52983.

    V2 workaround (no plugin needed)

    A separate provider pointing directly at the Copilot endpoint makes the working models selectable:

    "providers": {
      "copilot": {
        "name": "GitHub Copilot",
        "package": "@opencode/ai/providers/openai-compatible",
        "settings": {
          "baseURL": "https://api.individual.githubcopilot.com",
          "apiKey": "<copilot oauth token>"
        },
        "models": { "gpt-4.1": {}, "gpt-4o": {}, "gpt-4o-mini": {} }
      }
    }

    This makes copilot/gpt-4.1 selectable and callable.

    Environment

    • opencode v2.0.26 (latest channel)
    • Windows (Windows_NT 10.0.17763), PowerShell / cmd
    • No plugins active
  11. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

  12. pipounix commented on Oct 11, 2026

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions