Draft
Conversation
Co-authored-by: Caleb-Lite <175520785+Caleb-Lite@users.noreply.github.com>
Co-authored-by: Caleb-Lite <175520785+Caleb-Lite@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for GitHub Copilot OAuth integration
feat: add GitHub Copilot OAuth support
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds GitHub Copilot as a provider, enabling users with Copilot subscriptions (Pro+, etc.) to route models through
api.githubcopilot.com.Auth
OAuth Device Authorization Grant (RFC 8628) using the same client ID as VS Code's Copilot extension (
Iv1.b507a08c87ecfe98). Two-step token flow:api.github.com/copilot_internal/v2/tokenTokens auto-refresh before each request. Credentials stored at
~/.claudish/copilot-oauth.jsonwith0600permissions.Provider routing
copilot@,gh@,ghc@copilot/,gh/,ghc//chat/completions), so reusesOpenAIHandlerOpenAIHandler extension
Added optional
getApiKey(async token getter) andextraHeadersto the constructor, avoiding a separate handler class. Copilot-specific headers (Editor-Version,Copilot-Integration-Id, etc.) are injected at request time.Files touched
All changes applied across the 3 manually-synced package copies (
src/,packages/core/src/,packages/cli/src/):auth/copilot-oauth.ts— new OAuth moduleproviders/model-parser.ts— shortcuts,DIRECT_API_PROVIDERS, legacy prefixesproviders/remote-provider-registry.ts— provider config + name mapproviders/provider-resolver.ts— API key info + display nameproxy-server.ts— handler routinghandlers/openai-handler.ts— dynamic auth supportpackages/cli/src/index.ts—--copilot-login/--copilot-logoutflagspackages/cli/src/cli.ts— help textWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
openrouter.ai/home/REDACTED/work/_temp/ghcca-node/node/bin/bun bun test tests/remote-provider.test.ts git conf�� get --global d-run credential.userngit(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/bun bun test tests/remote-provider.test.ts git /.bi��(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/bun bun test tests/remote-provider.test.ts git ish/�� rs/openai-handler.ts --global k/_temp/copilot-developer-action-main/dist/ripgrep/bin/linux-x64/rg user.email(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.