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

Closed
opened 2026-02-16 17:33:38 -05:00 by yindo · 5 comments
Owner

Originally created by @chindris-mihai-alexandru on GitHub (Oct 7, 2025).

Originally assigned to: @thdxr on GitHub.

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.

Originally created by @chindris-mihai-alexandru on GitHub (Oct 7, 2025). Originally assigned to: @thdxr on GitHub. ## 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`: ```typescript 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.
yindo closed this issue 2026-02-16 17:33:38 -05:00
Author
Owner

@rekram1-node commented on GitHub (Oct 7, 2025):

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)
@rekram1-node commented on GitHub (Oct 7, 2025): > 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)
Author
Owner

@chindris-mihai-alexandru commented on GitHub (Oct 7, 2025):

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.

@chindris-mihai-alexandru commented on GitHub (Oct 7, 2025): 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.
Author
Owner

@rekram1-node commented on GitHub (Oct 7, 2025):

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?

@rekram1-node commented on GitHub (Oct 7, 2025): 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?
Author
Owner

@chindris-mihai-alexandru commented on GitHub (Oct 7, 2025):

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

@chindris-mihai-alexandru commented on GitHub (Oct 7, 2025): Yes, all good! Case closed. Thank you for your quick support!
Author
Owner

@rekram1-node commented on GitHub (Oct 7, 2025):

ofc!

@rekram1-node commented on GitHub (Oct 7, 2025): ofc!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1992