Skip to content

copilot: connected OAuth provider syncs no models — silent failure, models never become available #58219

Closed as not planned

Description

@CristianLopGon

Summary

After completing the GitHub Copilot device-flow login in the TUI, the stored credential is valid (the Copilot API returns the user's model list), but OpenCode never exposes any github-copilot/* model: GET /api/model keeps returning only opencode/* models, and selecting any Copilot model fails with Model unavailable. No sync error is logged.

Environment

  • opencode version: v2.1.3
  • OS: Linux 6.18.54.1-microsoft-standard-WSL2 (x86_64, WSL2)
  • Terminal: xterm-256color (TERM_PROGRAM unset)
  • Shell: /bin/bash
  • Install/channel: latest
  • Active plugins: none found in config

Reproduction

  1. Run /connect in the TUI, choose GitHub Copilot → Login with GitHub Copilot → GitHub.com, complete the device flow in the browser. Server logs the credential as created (integrationID github-copilot, type oauth, active true).
  2. opencode auth list shows GitHub Copilot stored.
  3. opencode models lists only the 9 opencode/* free models; no github-copilot/* entries appear.
  4. Run any Copilot model: opencode run --model github-copilot/gpt-5-mini "hi" → immediate Error: Model unavailable: github-copilot/gpt-5-mini (server logs SessionRunnerModel.ModelUnavailableError).
  5. GET /api/provider shows github-copilot with activation: "auto" (before config) — setting an explicit providers: {"github-copilot": {}} in ~/.config/opencode/opencode.json and calling opencode reload flips activation to enabled, but no models appear.
  6. Force a service restart: same result.

Expected Behavior

The CLI docs state OpenCode "fetches the account's current model list after login and whenever the active Copilot account changes" and that a failed sync is logged as failed to sync GitHub Copilot models. Expected: github-copilot models from the account become selectable in /models and via opencode run --model github-copilot/<id>.

Actual Behavior

No Copilot model ever becomes available in any client (TUI, opencode run, GET /api/model), both via the shared background service and --standalone mode. Notably, no failed to sync GitHub Copilot models warning is logged — the sync attempt appears to be silently skipped or swallowed.

Additional Context

Evidence that the account and token are valid (i.e., not an entitlement problem):

  • Directly calling Copilot's API with the stored OAuth token returns 48 models:
    GET https://api.individual.githubcopilot.com/models with Authorization: Bearer <stored token> → HTTP 200, 48 model entries.
  • The cached models.dev catalog in the background service (kv key models-dev:catalog) contains github-copilot with 36 models.
  • The integration endpoint reports a live connection: GET /api/integration/github-copilot → connections: [{type: credential, active}].
  • GET /api/provider/github-copilot shows the provider without any account-resolved models.

Completely reproducible across: shared service restart, opencode reload, opencode auth switch <integration> <label>, explicit provider activation in config, and a fresh --standalone server. Workarounds tried (none made models appear): config activation, auth switch, service restart, standalone mode.

Activity

  1. opencode-agent commented on Oct 22, 2026

    @opencode-agent
    Contributor

    Thanks for the thorough report and for checking the Copilot API directly with the stored token.

    In 2.1.3 the failed to sync GitHub Copilot models warning is only logged when the request to Copilot's /models fails. Since you saw no warning, the sync most likely worked and the models were filtered out afterwards. A known cause: on some Copilot plans (Free / Student, which only allow Auto model selection), /models returns model_picker_enabled: false for every model, and OpenCode then hides all of them.

    Could you tell us:

    1. Which Copilot plan the account is on (Free, Student/Education, Pro, Pro+, Business or Enterprise).
    2. In the GET https://api.individual.githubcopilot.com/models response you already fetched, how many models have "model_picker_enabled": true. For example: ... | jq '[.data[] | select(.model_picker_enabled == true)] | length'

    You can reply here, or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.

    Possibly related issues, ordered by likelihood:

  2. opencode-agent commented on Oct 25, 2026

    @opencode-agent
    Contributor

    We're closing this for now because we haven't heard back. We needed your Copilot plan and how many models in your /models response have "model_picker_enabled": true. Without those we can't tell whether this is the known auto-only plan problem or something new.

    If you're on Copilot Free or Student, follow #57955 and #34644 (a github-copilot/auto model for those plans is being worked on in #55960). If your plan is different, or some models do have model_picker_enabled: true, reply here with those details and we'll reopen this. Thanks again 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

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions