Skip to content

Expose OpenAI OAuth in AI settings#2401

Draft
Bortlesboat wants to merge 1 commit into
tinyhumansai:mainfrom
Bortlesboat:codex/openai-oauth-settings
Draft

Expose OpenAI OAuth in AI settings#2401
Bortlesboat wants to merge 1 commit into
tinyhumansai:mainfrom
Bortlesboat:codex/openai-oauth-settings

Conversation

@Bortlesboat
Copy link
Copy Markdown
Contributor

@Bortlesboat Bortlesboat commented May 21, 2026

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

  • New self-contained OpenAiOAuthConnect component: status probe → start → paste loopback redirect URL → complete, plus disconnect. All driven by the existing core RPCs; no backend changes.
  • Wired into the OpenAI provider's ProviderKeyDialog (the API-key field stays as the alternative path).
  • Two-step paste flow mirrors onboarding intentionally — the system browser redirects to a local http://127.0.0.1:1455/ callback the desktop app can't read directly.
  • All user-facing strings localized (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.
  • Extended the existing AIPanel "open OpenAI dialog" test to assert the ChatGPT sign-in surface renders.
  • Green locally: tsc --noEmit, ESLint (0 errors), Prettier, pnpm i18n:check (0 missing/extra/drift), 38 tests.

Notes

  • This supersedes the earlier version of this PR, rebased cleanly onto current main and reworked against the present AIPanel.tsx.
  • Follow-up opportunity (not in this PR to keep the diff focused): onboarding's inline OAuth block could later be replaced with this shared component to dedupe.
  • Local pre-push hook's lint:commands-tokens step can't run on Windows (it's a bash -c '… { } …' script cmd.exe rejects) and scans src/components/commands/, which this PR doesn't touch — it runs fine on CI/Linux. All other hook steps (format, lint, compile) pass.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 728c45e2-c6c6-45f1-b735-3307344b068b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Bortlesboat Bortlesboat force-pushed the codex/openai-oauth-settings branch 2 times, most recently from 1866c31 to f756281 Compare May 21, 2026 02:19
@oxoxDev oxoxDev assigned oxoxDev and unassigned oxoxDev May 28, 2026
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%).
@Bortlesboat Bortlesboat force-pushed the codex/openai-oauth-settings branch from f756281 to f0f5c35 Compare May 30, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants