Skip to content

Native ChatGPT/Codex subscription sign-in without the Codex CLI installed #5778

Description

@Hmbown

User report (2026-08-31): connecting a ChatGPT/Codex subscription currently requires the Codex CLI installed, because the only credential source for the openai-codex route is the external ~/.codex/auth.json (now behind the explicit-consent path from #5772). Most harnesses (e.g. opencode) offer a native browser sign-in.

Current state (verified from source):

  • The codex_oauth route itself is first-class: openai-codex provider, Responses API via https://chatgpt.com/backend-api, oauth_only, official-route guard in route_runtime.
  • crates/tui/src/oauth.rs only loads the external CLI's auth.json (read-only, consent-gated after Make provider selection explicit; stop implicit external CLI credential reuse #5772). There is no PKCE authorize/callback flow.
  • xAI already has this solved the right way: xai_oauth.rs implements native device-code login against auth.x.ai with refresh, no grok CLI needed.

Acceptance:

  • /provider setup openai-codex (or picker) offers 'Sign in with ChatGPT' — browser PKCE flow with a localhost callback (or device code if offered by the issuer), storing tokens in CodeWhale's own secure store with refresh, independent of any Codex CLI install.
  • Token custody stays local; same consent/disclosure language family as Make provider selection explicit; stop implicit external CLI credential reuse #5772; revoke path included.
  • The external-CLI import path remains as an explicit alternative, not a prerequisite.
  • Picker/setup copy distinguishes 'subscription (ChatGPT sign-in)' from API-key billing ownership before any run.
  • Terms check first: confirm OpenAI's current terms permit third-party harness sign-in via the published Codex OAuth client; if ambiguous, document the boundary rather than smuggling it.

Related: #5772 (explicit consent for external CLI credentials), #5755 (picker authority), #5092 (Responses provider-profiling).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions