Repository navigation
Description
Area
Authentication and account pool
What are you trying to accomplish?
Operate a headless OpenCodex hub in Kubernetes using only the ChatGPT/Codex device-code login flow, including when reauthenticating an existing pool account from the dashboard. An operator should be able to complete the login on another device without first starting a localhost callback flow.
What prevents this today?
The dashboard reauthentication modal automatically starts browser OAuth: gui/src/components/use-add-codex-account-oauth.ts calls startOAuth() when reauthAccountId is set, without the device option. The same hook sends device: true only for an explicit device selection. In a remote hub this immediately creates an unwanted browser login attempt, and a subsequent device attempt can encounter a login-already-in-progress conflict. The reported dashboard showed that conflict; its precise cause has not been established. The existing open-browser preference is not a device-flow preference.
What should OpenCodex do?
Provide an explicit, persistent Codex authentication method setting that can select device-code-only operation. When enabled, dashboard add and reauthentication actions should start the device flow directly, without automatically starting a browser callback flow. Make the setting apply consistently to relevant Codex login entry points, and make its enforcement and scope clear to the operator. Preserve existing behavior by default for installations that do not opt in. Device authorization remains OAuth; this request is about the authorization flow, not removing OAuth or changing other providers.
Example usage or interface
For example, an operator enables a Codex authentication setting in the dashboard or configuration and chooses device-only. Clicking Reauthenticate on a pool account immediately displays the verification URL and short device code; no localhost callback login is started. The exact setting name and interface are implementation choices. The device login must retain the existing same-account identity checks for reauthentication.
Alternatives or workarounds
The existing dashboard device-flow choice and the ocx account login openai --id <account-id> --reauth --device CLI option can start a device login explicitly, but the reauthentication modal first starts browser OAuth automatically. Issue #3366 introduced device authorization support; it did not request a persistent device-only policy. Issue #3898 concerns the separate native main account reauthentication path, not a default or restriction for Codex login methods.
Additional context
The affected installation is a remote single-replica Kubernetes hub. The backend already accepts device: true in src/codex/auth-api/login-flow.ts, so this request is for selection and optional enforcement of the existing flow rather than a new OAuth implementation.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
github-actions commentedon Nov 1, 2026
Automated translation bookkeeping — detected language: English.
shu-chen-dot-ca commentedon Nov 9, 2026
I'm taking this one on.
feat(codex): add codexAuthMethod device-only login policy (lidge-jun#…