Skip to content

CodexAuthPlugin loads but OAuth login methods not presented in auth CLI #13231

Closed as not planned

Description

@illyssey

Bug

opencode auth login → select OpenAI → goes straight to "Enter your API key" instead of showing the login method selector with OAuth options.

Environment

  • opencode v1.1.56 (Homebrew, macOS arm64)
  • Also reproduced on dev branch built from source

Investigation

  1. The built-in CodexAuthPlugin from src/plugin/codex.ts does load (confirmed via debug logging in plugin/index.ts — prints auth.provider=openai)
  2. The "(ChatGPT Plus/Pro or API key)" hint in the provider selector is hardcoded in src/cli/cmd/auth.ts line ~297 — not from the plugin
  3. After selecting OpenAI, Plugin.list().findLast(x => x.auth?.provider === provider) at line ~310 should find the CodexAuthPlugin, but the code falls through to the plain "Enter your API key" prompt
  4. The third-party opencode-openai-codex-auth npm plugin is explicitly blocked at plugin/index.ts line ~56

Expected

After selecting OpenAI, a "Login method" selector should appear with options:

  • ChatGPT Pro/Plus (browser)
  • ChatGPT Pro/Plus (headless)
  • Manually enter API Key

(Same pattern as Anthropic's "Claude Pro/Max" login method selector)

Steps to Reproduce

  1. opencode auth login
  2. Select "OpenAI"
  3. Observe: jumps straight to "Enter your API key" — no login method options

Notes

  • Anthropic auth works correctly (shows Claude Max vs API Key selector) because it uses the opencode-anthropic-auth BUILTIN npm package
  • The third-party plugin skip at line 56 means users can't work around this by installing the npm plugin

Activity

  1. github-actions commented on Feb 12, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These may be related to the same underlying plugin resolution mechanism.

  2. murtuzaalisurti commented on Feb 25, 2026

    @murtuzaalisurti

    experiencing the same, it goes straight to "Enter an API Key"

  3. murtuzaalisurti commented on Feb 25, 2026

    @murtuzaalisurti

    @illyssey plugins are overriding the auth methods, here's a plugin which might be causing this issue for you (removing it foxed for me) - see #10063 (comment)

  4. assigned and unassigned on Apr 26, 2026
  5. rekram1-node commented on May 21, 2026

    @rekram1-node
    Collaborator

    Make sure u arent using plugins that override/break it, and also make sure u arent disabling it w/ OPENCODE_DISABLE_DEFAULT_PLUGINS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions