microsoft / microsoft/vscode

BYOK Custom Endpoints Blocked by GitHub Sign-In Without Copilot

Open
#324,310 4 comments 4 reactions 1 assignee Claimed by @dmitrivMS View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Summary

**VS Code prevents BYOK (Bring Your Own Key) custom endpoint models from working when you're signed into GitHub without a Copilot entitlement.**

## The Problem

When you sign into GitHub in VS Code but don't have a Copilot seat (e.g., you're a GitHub Enterprise user without Copilot, or your subscription lapsed), VS Code refuses to activate BYOK custom endpoint providers. This blocks access to your own AI endpoints even though they have nothing to do with Copilot.

**The workaround:** Sign out of GitHub entirely. Then BYOK endpoints work again.

This is a logic bug: being signed in without Copilot access should not block independent BYOK endpoints. Users experience this as: "My custom AI endpoints work when I'm signed out of GitHub, but stop working the moment I sign in (unless I have Copilot)." This is due to improper nesting of logic inside VS Code.

## Impact

This affects:

- GitHub Enterprise users without Copilot seats
- Users whose Copilot subscriptions have lapsed
- Anyone using BYOK endpoints who wants to stay signed into GitHub for Git/GitHub features

## Steps to Reproduce

1. Configure a BYOK custom endpoint model in `chatLanguageModels.json`
2. Sign into GitHub in VS Code (account without Copilot entitlement)
3. Reload VS Code
4. Select the custom endpoint model in Chat
5. Send a request; it fails with `Language model unavailable`
6. Sign out of GitHub in VS Code
7. Reload VS Code
8. Same model now works

## Expected Behavior

BYOK custom endpoints should work independently of Copilot entitlement status. The only thing that should matter is whether you have valid BYOK configuration.

## Current Behavior

VS Code blocks BYOK provider registration when:

- Signed out of GitHub: BYOK works
- Signed in with Copilot: BYOK works
- Signed in without Copilot: BYOK **fails** (bug)

## Technical Root Cause

In `BYOKContrib`, provider registration uses this logic:

```ts
isClientBYOKAllowed(!!this._authService.anyGitHubSession, this._authService.copilotToken)
```

The current policy incorrectly denies BYOK when there's a GitHub session but no Copilot token. This creates the broken behavior where being signed in without Copilot is worse than being signed out.

## Environment

- VS Code Version: 1.128.0-insider (user setup)
- VS Code Commit: 3fbc14e67322245a87adf07c3da0c487e7715918
- Build Date: 2026-07-03T17:48:37+02:00
- Copilot Chat Extension Version: 0.56.2026070305
- Copilot Chat Extension Build: 1
- Copilot Completions Core Version: 1.378.1799
- Electron: 42.5.0
- ElectronBuildId: 14525058
- Chromium: 148.0.7778.271
- Node.js: 24.17.0
- V8: 14.8.178.33-electron.0
- OS: Windows_NT arm64 10.0.28000

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.