Add GitHub Copilot provider#3
Merged
notlikejuice merged 1 commit intomainfrom Jun 15, 2025
Hidden character warning
The head ref may contain hidden characters: "codex/popraw-logik\u0119-logowania-w-cli.tsx"
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new GitHub Copilot provider configuration and integrates a corresponding API key retrieval function into the CLI login flow.
- Added a new "githubcopilot" provider configuration in providers.ts
- Implemented fetchGithubCopilotApiKey in get-api-key.tsx to support GitHub Copilot token retrieval
- Incorporated provider-specific API key fetching in cli.tsx for login functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| codex-cli/src/utils/providers.ts | Added configuration for the GitHub Copilot provider |
| codex-cli/src/utils/get-api-key.tsx | Introduced the fetchGithubCopilotApiKey function for retrieving the GitHub Copilot token |
| codex-cli/src/cli.tsx | Updated the CLI login flow to include provider-specific key fetching for GitHub Copilot |
Comment on lines
+332
to
+336
| if (provider.toLowerCase() === "githubcopilot") { | ||
| apiKey = await fetchGithubCopilotApiKey(); | ||
| } else { | ||
| apiKey = await fetchApiKey(client.issuer, client.client_id); | ||
| } |
There was a problem hiding this comment.
The logic for fetching the API key for the GitHub Copilot provider is repeated in separate conditional blocks (lines 332-336 and 349-352). Consider refactoring this into a single helper function that handles provider-specific API key retrieval to improve maintainability.
Suggested change
| if (provider.toLowerCase() === "githubcopilot") { | |
| apiKey = await fetchGithubCopilotApiKey(); | |
| } else { | |
| apiKey = await fetchApiKey(client.issuer, client.client_id); | |
| } | |
| apiKey = await getApiKeyForProvider(provider, client.issuer, client.client_id); |
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.
Summary
githubcopilotprovider configurationfetchGithubCopilotApiKeyTesting
pnpm buildpnpm test(fails: raw-exec-process-group.test.ts)https://chatgpt.com/codex/tasks/task_e_684f237b111083268d65d4f2fd75eac8