feat(auth): add ChatGPT Plus/Pro OAuth provider - #1529
Conversation
🦋 Changeset detectedLatest commit: c61ffef The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
789a5a3 to
4d824e7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d824e7a3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| supportEfforts, | ||
| defaultEffort: model.defaultEffort ?? (supportEfforts.includes('medium') ? 'medium' : supportEfforts[0]), | ||
| }; | ||
| } | ||
| const selection = await runModelSelector(host, modelDict); |
There was a problem hiding this comment.
Initialize the selector with a supported thinking effort
When a user completes ChatGPT login and accepts the initially selected model without changing the thinking control, every alias here has concrete supportEfforts. runModelSelector initializes that first alias with 'on', but ModelSelectorComponent treats 'on' as invalid for an effort-backed model and clamps it to the first segment, 'off'; consequently selection.thinking !== 'off' persists thinking.enabled = false. The default login path therefore silently disables reasoning instead of using the model's declared default effort.
Useful? React with 👍 / 👎.
| if (this.isOpenAICodexAuth(providerName, oauthRef)) { | ||
| return createOpenAICodexTokenProvider({ | ||
| storage: new FileTokenStorage(join(this.options.homeDir, 'credentials')), | ||
| providerName, | ||
| oauthRef, | ||
| }); |
There was a problem hiding this comment.
Map revoked ChatGPT tokens to login-required errors
When a stored ChatGPT refresh token is revoked or expires, createOpenAICodexTokenProvider throws OAuthUnauthorizedError directly here. The SDK facade added in the same commit wraps this provider with mapOAuthTokenError, but the service-backed runtime uses this facade through CoreProcessService; it will therefore emit an unclassified/internal error rather than auth.login_required, so clients such as the TUI do not show the /login remediation for an expired ChatGPT session.
Useful? React with 👍 / 👎.
220c8d2 to
d529b50
Compare
d529b50 to
c61ffef
Compare
Related Issue
Resolves #1523
Problem
See linked issue.
What changed
This integration uses the ChatGPT Codex backend rather than OpenAI API-key billing. Model visibility and metadata come from the authenticated account when available.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.