VS Code Codex extension repeatedly requires sign-in with ChatGPT auth, but works with API key auth
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:
- Sign into Codex via ChatGPT OAuth
- Restart VS Code
- Codex prompts for sign-in again
- Logs show account/read failure
What is the expected behavior?
Codex should reuse valid OAuth session from ~/.codex/auth.json
Additional information
_No response_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Request failed error={"code":-32600,"message":"email and plan type are required for chatgpt authentication"} method=account/read
Also
~/.codex/auth.jsonexists andlast_refreshupdates with each loginTo 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.)?
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.
I think this is a duplicate of #13007, and I have a PR that should fix it: https://github.com/openai/codex/pull/13072.
This will be fixed in the next release