Skip to content

GitHub Copilot integration: Missing custom loader in provider.ts #3019

Closed

Description

Summary

GitHub Copilot integration is mostly implemented but missing from the custom loaders configuration, preventing it from being used in OpenCode.

Current State Analysis

✅ Already Implemented:

  • GitHub Copilot authentication (src/auth/github-copilot.ts) with OAuth device flow
  • All necessary authentication infrastructure is in place

❌ Missing:

  • GitHub Copilot is not included in the CUSTOM_LOADERS object in packages/opencode/src/provider/provider.ts

Testing Results

Tested on: macOS with GitHub Copilot Pro subscription

✅ Currently Working Models (9):

  • sonnet-4, o4-mini (preview), gpt-4.1, gemini-2.5-pro, o3-mini, sonnet-3.5, gpt-5, grok-code-fast-1, gpt-4o

❌ Currently Not Working Models (9):

  • o3-preview, opus-4, gpt-5-codex, opus-4.1, sonnet-4.5 (preview), gpt-5-mini, gemini-2.0-flash, sonnet-3.7-thinking, sonnet-3.7

Available Models

GitHub Copilot provides 18 models through their API:

Claude Models (7):

  • claude-opus-4, claude-opus-4.1, claude-3.5-sonnet, claude-3.7-sonnet, claude-3.7-sonnet-thinking, claude-sonnet-4, claude-sonnet-4.5 (preview)

Gemini Models (2):

  • gemini-2.0-flash, gemini-2.5-pro

GPT Models (8):

  • gpt-4.1, gpt-4o, gpt-5, gpt-5-codex, gpt-5-mini, o3 (preview), o3-mini, o4-mini (preview)

Other Models (1):

  • grok-code-fast-1

Solution

Add GitHub Copilot to the CUSTOM_LOADERS object in packages/opencode/src/provider/provider.ts:

const CUSTOM_LOADERS = {
  // ... existing loaders
  "github-copilot": () => import("../auth/github-copilot.js"),
};

This should enable all 18 GitHub Copilot models to work with the existing authentication system, including the 9 models that are currently not working.

Technical Details

  • Authentication method: OAuth device flow (already implemented)
  • API endpoint: GitHub Copilot Chat Completions API
  • Model filtering: Should support all available models, not restrict to a subset

The integration should work seamlessly once the custom loader is properly registered.

Activity

  1. changed the title [-]GitHub Copilot Integration Issues - Missing Custom Loader and Fake Models[/-] [+]GitHub Copilot integration: Missing custom loader in provider.ts[/+] on Oct 7, 2025
  2. rekram1-node commented on Oct 7, 2025

    @rekram1-node
    Collaborator

    o3-preview, opus-4, gpt-5-codex, opus-4.1, sonnet-4-preview, gpt-5-mini, gemini-2.0-flash, sonnet-3.7-thinking, sonnet-3.7

    Some of these models definitely work, keep in mind you need the Pro+ subscription to access opus, o3, and some others see list here: https://docs.github.com/en/copilot/get-started/plans#models.

    I just tested gpt-5-mini, gemini 2.0 flash, sonnet 3.7 and they all work, are you sure you followed the guide? Some models require Pro+ subscription and a lot of models need to be specifically enabled in your copilot settings too.

    We should try to make tui handle these things better ofc but for now we do document this: https://opencode.ai/docs/providers/#github-copilot

    The only models I've seen issues with (tho there may be issue w/ o3-preview too):

    • gpt-5-codex (there is an open issue for this)
    • sonnet-3.7-thinking (there is an open issue for this)
  3. chindris-mihai-alexandru commented on Oct 7, 2025

    @chindris-mihai-alexandru
    Author

    Hi Aiden! Yes, it should be as you say. I'm on the Copilot Pro subscription, not the Pro+ one. I didn't have some models enabled in my GitHub Copilot settings, and now that I've enabled them, I have access to and can work with Sonnet 4.5 (preview), GPT-5-mini, Gemini 2.0 Flash, Sonnet 3.7 Thinking, and Sonnet 3.7. For GPT-5-Codex, I still get errors, although I enabled it just now. But, as you mentioned, there are issues with that, so I'll wait for a fix. And, indeed, I should be on the ultimate tier of Copilot to be able to access Opus 4, Opus 4.1, and the O3 model.

  4. rekram1-node commented on Oct 7, 2025

    @rekram1-node
    Collaborator

    We should do some github api stuff to hide models you dont have or make it known that you need to enable better but otherwise it sounds like we got this resolved then?

  5. chindris-mihai-alexandru commented on Oct 7, 2025

    @chindris-mihai-alexandru
    Author

    Yes, all good! Case closed. Thank you for your quick support!

  6. rekram1-node commented on Oct 7, 2025

    @rekram1-node
    Collaborator

    ofc!

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