feat(cli): add OpenAI Codex OAuth authentication support#11935
Open
roomote-v0[bot] wants to merge 1 commit intomainfrom
Open
feat(cli): add OpenAI Codex OAuth authentication support#11935roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
Adds support for using ChatGPT Plus/Pro subscription-based authentication in the CLI via OpenAI Codex OAuth, matching the existing VSCode extension capability. Changes: - Add openai-codex as a supported CLI provider - Add roo auth login-openai / logout-openai / status-openai commands - Implement PKCE OAuth flow for CLI (reuses OpenAI auth endpoints) - Store credentials in vscode-shim secret storage for transparent integration with the existing OpenAiCodexHandler - Update run.ts to validate OAuth credentials for openai-codex provider - Add provider settings handling for openai-codex - Add comprehensive tests for credential storage Closes #11926
2 tasks
Contributor
|
@roomote mark this ready for review |
Contributor
Author
Marked this PR as ready for review. |
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.
Related GitHub Issue
Closes: #11926
Description
This PR attempts to address Issue #11926 by extending OpenAI Codex OAuth authentication from the VSCode extension into the CLI.
Changes:
openai-codexas a supported CLI provider intypes.tsroo auth login-openai- Performs PKCE OAuth flow against OpenAI auth endpoints, stores credentialsroo auth logout-openai- Clears stored OpenAI Codex credentialsroo auth status-openai- Shows current OpenAI Codex auth status (email, expiration)openai-codex-credentials.ts) - Stores OAuth credentials in the vscode-shim secret storage (~/.vscode-mock/global-storage/secrets.json) so the existingOpenAiCodexOAuthManagerandOpenAiCodexHandlerwork transparently when the extension loadsprovider.tshandlesopenai-codexprovider (no API key needed)run.tsvalidates OAuth credentials exist when--provider openai-codexis used, and skips the API key requirementUsage:
Feedback and guidance are welcome.
Test Procedure
cd apps/cli && npx vitest run src/lib/storage/__tests__/openai-codex-credentials.test.tsPre-Submission Checklist
Documentation Updates
roo auth login-openai/logout-openai/status-openaicommands and the--provider openai-codexoption.Additional Notes
src/integrations/openai-codex/oauth.ts)OpenAiCodexHandlerpicks them up transparently viaopenAiCodexOAuthManageropenAiCodexOAuthManagerwhen the extension loadsInteractively review PR in Roo Code Cloud