Skip to content

fix(codex): remove device code login - #1792

Merged
zerob13 merged 1 commit into
devfrom
codex/openai-codex-oauth-only
Jun 20, 2026
Merged

fix(codex): remove device code login#1792
zerob13 merged 1 commit into
devfrom
codex/openai-codex-oauth-only

Conversation

@zerob13

@zerob13 zerob13 commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Remove OpenAI Codex device-code login routes, presenter/client APIs, auth polling, and status shape
  • Simplify the OpenAI Codex settings UI to browser OAuth only
  • Add SDD docs and update focused tests/i18n keys

Tests

  • pnpm exec vitest run test/main/routes/contracts.test.ts test/main/routes/dispatcher.test.ts test/renderer/api/clients.test.ts test/main/presenter/openaiCodexAuth.test.ts test/renderer/components/OpenAICodexOAuth.test.ts
  • pnpm run format
  • pnpm run i18n
  • pnpm run lint
  • pnpm run typecheck

Summary by CodeRabbit

  • Changes

    • OpenAI Codex sign-in now exclusively uses browser-based authentication; device-code login method removed.
    • Sign-in UI simplified with device verification interface removed.
    • Translations updated across all supported languages.
  • Documentation

    • Added implementation plan, specification, and task documentation for OAuth consolidation.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7daebbc1-4dc9-4f19-9192-cb9da32fc5b8

📥 Commits

Reviewing files that changed from the base of the PR and between bc97066 and 10b6dd0.

📒 Files selected for processing (38)
  • docs/issues/openai-codex-oauth-only/plan.md
  • docs/issues/openai-codex-oauth-only/spec.md
  • docs/issues/openai-codex-oauth-only/tasks.md
  • src/main/presenter/oauthPresenter.ts
  • src/main/presenter/openaiCodexAuth/constants.ts
  • src/main/presenter/openaiCodexAuth/index.ts
  • src/main/routes/index.ts
  • src/renderer/api/OAuthClient.ts
  • src/renderer/settings/components/OpenAICodexOAuth.vue
  • src/renderer/src/i18n/da-DK/settings.json
  • src/renderer/src/i18n/de-DE/settings.json
  • src/renderer/src/i18n/en-US/settings.json
  • src/renderer/src/i18n/es-ES/settings.json
  • src/renderer/src/i18n/fa-IR/settings.json
  • src/renderer/src/i18n/fr-FR/settings.json
  • src/renderer/src/i18n/he-IL/settings.json
  • src/renderer/src/i18n/id-ID/settings.json
  • src/renderer/src/i18n/it-IT/settings.json
  • src/renderer/src/i18n/ja-JP/settings.json
  • src/renderer/src/i18n/ko-KR/settings.json
  • src/renderer/src/i18n/ms-MY/settings.json
  • src/renderer/src/i18n/pl-PL/settings.json
  • src/renderer/src/i18n/pt-BR/settings.json
  • src/renderer/src/i18n/ru-RU/settings.json
  • src/renderer/src/i18n/tr-TR/settings.json
  • src/renderer/src/i18n/vi-VN/settings.json
  • src/renderer/src/i18n/zh-CN/settings.json
  • src/renderer/src/i18n/zh-HK/settings.json
  • src/renderer/src/i18n/zh-TW/settings.json
  • src/shared/contracts/routes.ts
  • src/shared/contracts/routes/oauth.routes.ts
  • src/shared/types/openai-codex.ts
  • src/shared/types/presenters/core.presenter.d.ts
  • test/main/presenter/openaiCodexAuth.test.ts
  • test/main/routes/contracts.test.ts
  • test/main/routes/dispatcher.test.ts
  • test/renderer/api/clients.test.ts
  • test/renderer/components/OpenAICodexOAuth.test.ts
💤 Files with no reviewable changes (29)
  • src/renderer/src/i18n/it-IT/settings.json
  • src/renderer/src/i18n/fr-FR/settings.json
  • src/renderer/src/i18n/id-ID/settings.json
  • src/renderer/src/i18n/da-DK/settings.json
  • src/renderer/src/i18n/en-US/settings.json
  • src/renderer/src/i18n/pt-BR/settings.json
  • src/renderer/src/i18n/zh-CN/settings.json
  • src/renderer/src/i18n/es-ES/settings.json
  • src/renderer/src/i18n/he-IL/settings.json
  • src/renderer/src/i18n/ru-RU/settings.json
  • test/main/presenter/openaiCodexAuth.test.ts
  • src/main/presenter/openaiCodexAuth/constants.ts
  • src/renderer/src/i18n/ja-JP/settings.json
  • src/shared/types/openai-codex.ts
  • src/renderer/src/i18n/vi-VN/settings.json
  • src/renderer/src/i18n/de-DE/settings.json
  • src/main/presenter/oauthPresenter.ts
  • src/renderer/src/i18n/fa-IR/settings.json
  • src/renderer/src/i18n/pl-PL/settings.json
  • src/renderer/src/i18n/ms-MY/settings.json
  • src/renderer/api/OAuthClient.ts
  • src/renderer/src/i18n/ko-KR/settings.json
  • test/main/routes/dispatcher.test.ts
  • src/renderer/src/i18n/zh-HK/settings.json
  • src/renderer/src/i18n/zh-TW/settings.json
  • src/renderer/src/i18n/tr-TR/settings.json
  • src/shared/types/presenters/core.presenter.d.ts
  • src/main/presenter/openaiCodexAuth/index.ts
  • src/main/routes/index.ts

📝 Walkthrough

Walkthrough

Removes the OpenAI Codex device-code OAuth login flow across all application layers: shared type contracts drop pending-device state and device payload, the route schema and catalog remove oauthOpenAICodexStartDeviceLoginRoute, the main-process auth class loses all device-flow polling/implementation, the IPC dispatcher and renderer OAuth client drop the device-login handler, and the Vue settings component removes the device-code panel and button. Device-code i18n keys are removed from 18 locale files. Tests are updated to reflect browser-only behavior.

Changes

OpenAI Codex Browser-Only OAuth Consolidation

Layer / File(s) Summary
Shared types, route schema, and presenter interface
src/shared/types/openai-codex.ts, src/shared/contracts/routes/oauth.routes.ts, src/shared/contracts/routes.ts, src/shared/types/presenters/core.presenter.d.ts
OpenAICodexAuthState drops 'pending-device'; OpenAICodexAuthStatus removes the device payload object; oauthOpenAICodexStartDeviceLoginRoute is removed from the route schema and catalog; IOAuthPresenter replaces startOpenAICodexDeviceLogin with startOpenAICodexBrowserLogin and adds startGitHubCopilotDeviceFlowLogin.
Main-process auth implementation and IPC dispatcher
src/main/presenter/openaiCodexAuth/constants.ts, src/main/presenter/openaiCodexAuth/index.ts, src/main/presenter/oauthPresenter.ts, src/main/routes/index.ts
Removes OPENAI_CODEX_DEVICE_USER_CODE_URL/DEVICE_TOKEN_URL constants, PendingDeviceFlow type, pendingDeviceFlow state, getStatus device branch, startDeviceLogin, pollDeviceFlow, and postTokenJsonOrForm from OpenAICodexAuth; removes startOpenAICodexDeviceLogin from OAuthPresenter; drops the device-login switch case from the IPC dispatcher.
Renderer OAuth client and Vue settings component
src/renderer/api/OAuthClient.ts, src/renderer/settings/components/OpenAICodexOAuth.vue
createOAuthClient no longer imports or exposes startOpenAICodexDeviceLogin; OpenAICodexOAuth.vue removes the device-code panel, device login button, busyAction device branch, pending-device status text case, deviceButtonText computed, and all device-code helper functions.
Device-code i18n key removal (18 locales)
src/renderer/src/i18n/*/settings.json
Removes openaiCodexPendingDevice, openaiCodexUseDeviceCode, and device verification/copy/waiting keys from all 18 locale files; retains browser sign-in, disabled/error, account/plan, reconnect, sign-out, and cancel strings.
Test updates and planning docs
test/main/presenter/openaiCodexAuth.test.ts, test/main/routes/contracts.test.ts, test/main/routes/dispatcher.test.ts, test/renderer/api/clients.test.ts, test/renderer/components/OpenAICodexOAuth.test.ts, docs/issues/openai-codex-oauth-only/*
Removes device-login mocks, fixtures, and dispatch assertions across all affected test suites; adds pending-browser contract validation and asserts the device-login button is absent in the component test. Adds spec, plan, and tasks docs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1788: Directly related — introduced the startDeviceLogin/pending-device pathway in OpenAICodexAuth, OAuthPresenter, the route contracts, and the OpenAICodexOAuth.vue component that this PR removes.

Suggested reviewers

  • yyhhyyyyyy

🐇 No more device codes to wait and see,
The browser path is where auth should be!
pending-device? Gone without a trace,
ChatGPT sign-in takes its rightful place.
One flow to rule them all — hooray! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(codex): remove device code login' directly and clearly summarizes the main change: removing device-code login from OpenAI Codex.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/openai-codex-oauth-only

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.

@zerob13
zerob13 merged commit f171c4f into dev Jun 20, 2026
3 checks passed
@zhangmo8
zhangmo8 deleted the codex/openai-codex-oauth-only branch June 20, 2026 13:35
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.

1 participant