Expose OpenAI OAuth in AI settings#2401
Draft
Bortlesboat wants to merge 1 commit into
Draft
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1866c31 to
f756281
Compare
Bring the OpenAI inference OAuth flow ("Sign in with ChatGPT") to the AI
settings panel. The Rust core already implements the
`openhuman.inference_openai_oauth_{start,complete,status,disconnect}` RPCs
and onboarding (ApiKeysStep) already exposes them, but the settings panel
only accepted a manual API key — so users had no way to connect, re-check,
or disconnect ChatGPT after onboarding.
Adds a self-contained OpenAiOAuthConnect component (status probe -> start ->
paste loopback redirect URL -> complete, plus disconnect) and wires it into
the OpenAI provider's ProviderKeyDialog. The API-key field remains as the
alternative. All strings are localized; tests cover the connect, complete,
disconnect, desktop-only guard, and error paths (component lines 98.5%).
f756281 to
f0f5c35
Compare
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.
What
Brings the OpenAI inference OAuth flow ("Sign in with ChatGPT") to the AI settings panel.
The Rust core already implements
openhuman.inference_openai_oauth_{start,complete,status,disconnect}, and onboarding (ApiKeysStep) already exposes them — but the settings panel only accepted a manually pasted API key. So a user who skipped OAuth during onboarding (or wanted to re-check / disconnect later) had no way to manage ChatGPT sign-in from Settings. This closes that gap.How
OpenAiOAuthConnectcomponent: status probe → start → paste loopback redirect URL → complete, plus disconnect. All driven by the existing core RPCs; no backend changes.ProviderKeyDialog(the API-key field stays as the alternative path).http://127.0.0.1:1455/callback the desktop app can't read directly.en.ts+ chunk parity across all locales).Tests / checks
OpenAiOAuthConnect.test.tsx— 11 cases: connected/disconnected status, full start→complete flow, disconnect, desktop-only guard, missing-callback + start/complete/disconnect error paths. Component coverage 98.5% lines / 95% branches.tsc --noEmit, ESLint (0 errors), Prettier,pnpm i18n:check(0 missing/extra/drift), 38 tests.Notes
mainand reworked against the presentAIPanel.tsx.lint:commands-tokensstep can't run on Windows (it's abash -c '… { } …'script cmd.exe rejects) and scanssrc/components/commands/, which this PR doesn't touch — it runs fine on CI/Linux. All other hook steps (format, lint, compile) pass.