Skip to content

GitHub Copilot model sync times out on 2.0.32 (manual API works) #57264

Open

Description

@NAMKHANH145

Summary

OpenCode 2.0.32 fails to sync GitHub Copilot models. The log repeatedly shows:

"failed to sync GitHub Copilot models" cause="TimeoutError: The operation timed out."

This has occurred since 2026-10-02 across multiple sessions and survives re-authentication.

Environment

Reproduction

  1. opencode auth login github-copilot (device code) → Connected successfully.
  2. Restart OpenCode / run opencode models.
  3. No copilot models appear in opencode models (0 results).
  4. Log shows repeated "failed to sync GitHub Copilot models" TimeoutError.

Expected

Copilot models (claude-sonnet-5, gpt-5.6-luna, etc.) should appear in opencode models and be selectable.

Actual

No copilot models listed. Model sync times out.

Manual API verification (works)

TOKEN=$(opencode auth export | jq -r '.[] | select(.integrationID=="github-copilot") | .value.access')
curl -sS -m 10 -H "Authorization: Bearer $TOKEN" \
  -H "Editor-Version: vscode/1.95.0" -H "Copilot-Integration-Id: vscode-chat" \
  https://api.individual.githubcopilot.com/models
# Returns 24+ models in <1s

Additional context

  • Token is valid (gho_..., 40 chars, expires: 0).
  • Quota plugin (slkiser/opencode-quota) reports Copilot 100% remaining, reset in ~13 days — account is fine.
  • Network is fine (no firewall/AdGuard blocking; curl succeeds).
  • Re-auth (device code) does not resolve the timeout.
  • Other providers (Kilo, OpenRouter, OpenCode Zen) work fine.

Impact

GitHub Copilot models cannot be used in OpenCode 2.0.32 despite valid auth and working API. Workaround: use other providers.

Activity

  1. opencode-agent commented on Oct 20, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the curl comparison.

    I tried this on 2.0.32 (Linux, clean profile) against a mock of the Copilot /models endpoint. I couldn't reproduce the timeout itself, because that needs a real Copilot account, so a maintainer with one will need to check it.

    • When the endpoint answers quickly, the sync works and the models show up.
    • When the endpoint is slower than OpenCode's 5-second limit, I get exactly your failed to sync GitHub Copilot models ... TimeoutError log line. But opencode models still lists about 38 github-copilot/... models from the built-in fallback catalog, not 0.

    One difference from your curl: OpenCode sends X-GitHub-Api-Version: 2026-08-01 and its own User-Agent, and it does not send Editor-Version or Copilot-Integration-Id. If you have a moment, could you try your curl with the same headers as OpenCode, and check whether it hangs?

    curl -sS -m 10 -w '\n%{http_code} %{time_total}s\n' \
      -H "Authorization: Bearer $TOKEN" \
      -H "User-Agent: opencode/latest/2.0.32/cli" \
      -H "X-GitHub-Api-Version: 2026-08-01" \
      https://api.individual.githubcopilot.com/models | tail -c 300

    Since you see no Copilot models at all (not even the fallback list), it would also help to know:

    Related issues:

  2. NAMKHANH145 commented on Oct 20, 2026

    @NAMKHANH145
    Author

    Update: The timeout is not the (only) root cause. After re-authenticating Copilot, models initially appeared, then vanished — matching #55082 (Copilot models disappear when an OpenCode Console key is also stored).

    Current state:

    • Auth store has both github-copilot and opencode (Console) credentials.
    • opencode models shows 0 copilot models.
    • Manual curl to https://api.individual.githubcopilot.com/models with the stored token succeeds in ~1.5s (HTTP 200, returns 24+ models) even with OpenCode's headers (User-Agent: opencode/latest/2.0.32/cli, X-GitHub-Api-Version: 2026-08-01).
    • No proxy env vars set.
    • opencode-quota plugin is installed (but unrelated; the sync timeout predates it).

    So the real cause appears to be #55082: copilot models disappear when an OpenCode Console key is also stored. The timeout (#53413) compounds it (sync never retries until restart).

    Workaround from #55082: delete the opencode/opencode-go credential rows → Copilot returns, but loses Zen. Not acceptable for users who need both.

    Request: fix the conflict so Copilot models remain available when an OpenCode Console key is stored, and retry failed syncs automatically (#53413).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions