Skip to content

VS Code Codex extension repeatedly requires sign-in with ChatGPT auth, but works with API key auth #12170

Closed

Description

@TheMrAnderson

What version of the IDE extension are you using?

0.4.76

What subscription do you have?

Plus

Which IDE are you using?

VSCode

What platform is your computer?

Linux x64 (Ubuntu kernel 6.17.0-14-generic)

What issue are you seeing?

Problem:
Codex requires ChatGPT sign-in every time VS Code restarts.

Auth cache (~/.codex/auth.json) exists, refreshes correctly, and last_refresh updates.

However, extension logs show:

Request failed error={"code":-32600,"message":"email and plan type are required for chatgpt authentication"} method=account/read

This causes Codex to treat the session as unauthenticated and prompt sign-in again.

Switching to API key auth via OPENAI_API_KEY resolves the issue completely.

Actual behavior:
Codex fails account/read and forces re-authentication every launch.

Workaround:
Using OPENAI_API_KEY works correctly.

What steps can reproduce the bug?

Steps to reproduce:

  1. Sign into Codex via ChatGPT OAuth
  2. Restart VS Code
  3. Codex prompts for sign-in again
  4. Logs show account/read failure

What is the expected behavior?

Codex should reuse valid OAuth session from ~/.codex/auth.json

Additional information

No response

Activity

  1. added
    bugSomething isn't working
    authIssues related to authentication and accounts
    on Feb 18, 2026
  2. TheMrAnderson commented on Feb 18, 2026

    @TheMrAnderson
    Author

    Request failed error={"code":-32600,"message":"email and plan type are required for chatgpt authentication"} method=account/read

    Also ~/.codex/auth.json exists and last_refresh updates with each login

  3. etraut-openai commented on Feb 24, 2026

    @etraut-openai
    Contributor

    To confirm, you're able to log in using ChatGPT auth and use Codex successfully, but when you restart the extension, it asks you to log in again?

    There must be something unusual about your ChatGPT account or sign-in method because we haven't received similar reports from other users. What sign-in method are you using for ChatGPT? Are you using a password or a social media account (Google, etc.)?

  4. TheMrAnderson commented on Feb 27, 2026

    @TheMrAnderson
    Author

    Yes, and I just tried it on another computer running Windows. I am using an email/password, not a social media account. I created my Chat account with just a phone number and later had to add an email address for something - I can't remember exactly why now. When I sign into the VSCode Codex extension, I get walked through the tutorial and just click through the handful of clicks.

  5. etraut-openai commented on Feb 27, 2026

    @etraut-openai
    Contributor

    I think this is a duplicate of #13007, and I have a PR that should fix it: #13072.

  6. etraut-openai commented on Feb 28, 2026

    @etraut-openai
    Contributor

    This will be fixed in the next release

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues related to authentication and accountsbugSomething isn't workingextensionIssues related to the VS Code extension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions