Skip to content

Add GitHub Copilot provider#3

Merged
notlikejuice merged 1 commit intomainfrom
codex/popraw-logikę-logowania-w-cli.tsx
Jun 15, 2025

Hidden character warning

The head ref may contain hidden characters: "codex/popraw-logik\u0119-logowania-w-cli.tsx"
Merged

Add GitHub Copilot provider#3
notlikejuice merged 1 commit intomainfrom
codex/popraw-logikę-logowania-w-cli.tsx

Conversation

@notlikejuice
Copy link
Owner

Summary

  • add githubcopilot provider configuration
  • allow login via fetchGithubCopilotApiKey
  • call provider-specific login in CLI

Testing

  • pnpm build
  • pnpm test (fails: raw-exec-process-group.test.ts)

https://chatgpt.com/codex/tasks/task_e_684f237b111083268d65d4f2fd75eac8

Copilot AI review requested due to automatic review settings June 15, 2025 20:03
@notlikejuice notlikejuice merged commit b451a82 into main Jun 15, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
}
Copy link

Copilot AI Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant