Skip to content

copilot: no usable models listed — stale catalog, empty sync, no policy filtering #52983

Closed as duplicate

Description

@Luckyy05

Description

After connecting GitHub Copilot (OAuth device flow succeeds, credential stored and active), opencode models lists zero github-copilot/* models.

Direct API checks with the stored credential show the token is valid: GET https://api.githubcopilot.com/models returns ~49 models, each annotated with policy.state (enabled / disabled) and supported_endpoints. But OpenCode never surfaces a usable one:

  1. Dynamic sync yields nothing. With no explicit config, no github-copilot/* model appears, even though the provider is registered (GET /api/provider shows github-copilot with activation: auto) and the account has entitled models.
  2. Explicit providers.github-copilot.models entries only survive if the ID exists in the bundled snapshot catalog. IDs such as kimi-k3, gpt-5.4-mini, gpt-5.3-codex, claude-haiku-4.5, gpt-4o, gpt-4.1 (all policy-enabled for the account, all present in the current models.dev github-copilot catalog) are silently dropped on opencode reload. Only snapshot-era IDs (e.g. gpt-5.4, claude-sonnet-5.5, gemini-3.8-flash, claude-opus-5) are kept.
  3. The surviving snapshot IDs are all policy.state=disabled for the account, so using any of them fails: opencode run --model github-copilot/gemini-3.8-flash returns 400 model_not_supported. Snapshot IDs absent from the account's /models (e.g. kimi-k2.7-code) fail with 400 model_not_available_for_integrator "opencode".
  4. modelID overrides break routing. An explicit entry with a modelID different from its key (e.g. key gpt-5.4 with modelID: kimi-k3) is dropped entirely: provider.no-route / Model unavailable: github-copilot/gpt-5.4.

Net effect: there is no way to select a usable Copilot model — the selectable set (stale snapshot, all policy-disabled) and the usable set (policy-enabled, missing from snapshot) do not intersect.

Plugins

None (no plugins configured; no MCP servers).

OpenCode version

2.0.22 (@opencode/cli, latest channel; verified newest published version)

Steps to reproduce

  1. opencode auth login → select GitHub Copilot → complete the device flow (succeeds, credential active).
  2. opencode models → no github-copilot/* entries (only opencode/* free models).
  3. Add explicit models under providers.github-copilot.models in ~/.config/opencode/opencode.json, then opencode reload → only snapshot-era IDs appear; current IDs (kimi-k3, gpt-5.4-mini, gpt-4o, …) are dropped.
  4. opencode run "hi" --model github-copilot/gemini-3.8-flash → 400 {"code":"model_not_supported"}.

Screenshot and/or share link

N/A (CLI output; exact API error codes included above).

Operating System

Windows NT 10.0.26200 (win32 x64)

Terminal

PowerShell commands executed via local OpenCode server (TERM=xterm-256color)

Activity

  1. github-actions commented on Oct 3, 2026

    @github-actions
    Contributor

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

    • #42083: Copilot model filtering leaves the picker empty even when the API reports models as enabled and usable.
    • #51928: Copilot OAuth succeeds, but model sync does not populate the model list.
  2. edwardEsmerson commented on Oct 8, 2026

    @edwardEsmerson

    Additional reproduction and evidence from Linux/WSL2:

    Environment

    • OpenCode: v2.0.25, latest channel
    • OS: Linux under WSL2 (6.6.87.2-microsoft-standard-WSL2)
    • Shell: fish
    • Active plugin: /home/solan/src/opencode-plugins/opencode-usage

    Reproduction and observations

    1. Connect GitHub Copilot through the OAuth device flow.
    2. opencode auth list shows an active stored GitHub Copilot OAuth credential.
    3. The OpenCode service/API is healthy (opencode service status, /api/info).
    4. Immediately after login, the Copilot provider had zero models. The server log repeatedly reported:
    failed to sync GitHub Copilot models
    cause="TimeoutError: The operation timed out."
    
    1. Restarting the service temporarily repopulated 37 Copilot models, but the selectable inventory still omitted callable legacy models such as gpt-4.1 and gpt-4o-mini.
    2. OpenCode requests using visible models such as github-copilot/claude-haiku-5.5 and github-copilot/gpt-5-mini fail with:
    The requested model is not supported.
    

    Account/API verification

    Using the stored credential locally (token redacted):

    • GET https://api.githubcopilot.com/models returns HTTP 200.
    • GET https://api.github.com/copilot_internal/user reports chat_enabled: true and an individual free_educational_quota account.
    • Direct chat completions return HTTP 200 and COPILOT_OK for gpt-4.1 and gpt-4o-mini.
    • The same direct endpoint returns model_not_supported for the newer models OpenCode exposes.

    This indicates the OAuth credential, entitlement, and network are working. The failure appears to be stale/incorrect Copilot model discovery or filtering: OpenCode exposes models that are not callable for this account while omitting models that GitHub accepts.

    A reconnect did not resolve it; restarting the OpenCode service only refreshed the stale inventory temporarily.

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

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