Authentication should show login again if token expired or other token error

Resolved 💬 6 comments Opened Oct 25, 2025 by matssk Closed Nov 15, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.49

What subscription do you have?

Pro

Which model were you using?

_No response_

What platform is your computer?

_No response_

What issue are you seeing?

It's not working.

Every requests results in the error: exceeded retry limit, last status: 401 Unauthorized, request id: 99438b5929d256ae-OSL

What steps can reproduce the bug?

Try to do anything

What is the expected behavior?

Something should work

Additional information

_No response_

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5667
  • #5553
  • #5456

Powered by Codex Action

matssk · 10 months ago

Deleting auth.json and logging in again fixed the issue. I guess the login token had expired? Should show the login screen again if the token is expired instead of just showing an error.

etraut-openai contributor · 10 months ago

Thanks for the bug report. I'm glad to hear that deleting auth.json worked for you. If this happens again, you can also log out (using the /logout command in the CLI or the "Log out" menu item in the extension).

I presume you're logging with ChatGPT? Are you using the Codex CLI or the IDE extension? In either case, if your token expires, we should seamlessly refresh it for a new one.

matssk · 10 months ago

Logging in with ChatGPT in Codex CLI

Meowzz95 · 10 months ago

@etraut-openai i think something is wrong with the refresh logic, I got the same thing today (reconnecting 5/5 and throws 401) I had to logout and login again to make it work

etraut-openai contributor · 9 months ago

In recent versions, we've updated the refresh logic to surface the error.