Add GitHub Copilot provider with OAuth device flow#594
Open
RajPabnani03 wants to merge 1 commit intoathasdev:masterfrom
Open
Add GitHub Copilot provider with OAuth device flow#594RajPabnani03 wants to merge 1 commit intoathasdev:masterfrom
RajPabnani03 wants to merge 1 commit intoathasdev:masterfrom
Conversation
Implements GitHub Copilot as an AI provider (Issue athasdev#573) using OAuth device flow for authentication instead of static API keys. The Copilot chat API is OpenAI-compatible, with a two-step token chain: GitHub OAuth token (stored in keychain) exchanged for a short-lived Copilot API token (cached in Rust memory with 5-min expiry buffer). Rust backend (5 Tauri commands): - copilot_start_device_flow: initiates GitHub OAuth device flow - copilot_poll_device_token: polls for user authorization - copilot_get_auth_status: checks if authenticated - copilot_get_api_token: gets/refreshes Copilot API token with caching - copilot_logout: removes OAuth token and clears cache TypeScript provider: - CopilotProvider with buildHeadersAsync() for dynamic OAuth headers - Dynamic model fetching via Copilot API /models endpoint - OpenAI-compatible payload format UI: - CopilotAuthModal for device code OAuth flow (copy, countdown, polling) - Settings page replaces 'Coming Soon' with Sign In/Connected as UI - Provider model selector shows Authenticate/Sign Out for Copilot - CopilotIcon added to provider icons Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.
Implements GitHub Copilot as an AI provider using OAuth device flow authentication (closes #573).