codex icon indicating copy to clipboard operation
codex copied to clipboard

Refresh token was already used after session timed out

Open matssk opened this issue 1 year ago • 21 comments

What version of Codex is running?

0.56

What subscription do you have?

Pro

Which model were you using?

No response

What platform is your computer?

Linux 6.14.0-32-generic x86_64

What issue are you seeing?

If I leave a session idle for a couple days, I get the following message:

"Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again."

I don't need to log out and log in again to fix it, simply closing codex and opening it again works.

I do always have multiple sessions open in different terminals. Perhaps that's why the refresh token was already used?

What steps can reproduce the bug?

Leave a session idle for a few days

What is the expected behavior?

No response

Additional information

No response

matssk avatar Nov 11 '25 08:11 matssk

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

  • #6448
  • #6393

Powered by Codex Action

github-actions[bot] avatar Nov 11 '25 08:11 github-actions[bot]

any update on this issue?

VigneshNextrive avatar Dec 08 '25 13:12 VigneshNextrive

any update ?

keiwaya avatar Dec 26 '25 11:12 keiwaya

In my case i just need to reload the vs code, press crtl + shift + p and type reload window.

Image

sujarniel avatar Jan 05 '26 06:01 sujarniel

codex auth logout
codex auth login

ghoshsap avatar Jan 07 '26 07:01 ghoshsap

"Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again."

The only thing which worked for me (in Mint Linux) is to remove ~/.codex/auth.json and then to restart VSCode and login into ChatGPT again...

vitalij555 avatar Jan 08 '26 08:01 vitalij555

This will be fixed in the next release.

etraut-openai avatar Jan 08 '26 23:01 etraut-openai

just ran into this problem with the latest release 0.5.58......

Aqualie avatar Jan 09 '26 01:01 Aqualie

I just ran into the same problem with 0.5.58. I was running into this on 0.4.58 as well, for the past week. I am really struggling here. I have logged out and back in from everything. I have restarted. Not sure what to do so that I can continue working.

treymathews avatar Jan 09 '26 20:01 treymathews

The fix is not in 0.5.58. It will be in 0.5.59 and 0.4.59.

The workaround is to log in again, so this shouldn't block you from working. If you're blocked (unable to log in again), then you're experiencing a different problem.

etraut-openai avatar Jan 09 '26 20:01 etraut-openai

I can log out and log back in, but it doesn't fix the problem. i get the same error. Any other possible workarounds? Also, when will 0.5.59 and 0.4.59 be available?

treymathews avatar Jan 09 '26 22:01 treymathews

If logging out and logging back in doesn't work, then you're experiencing a different problem. It's unlikely that the next version will fix it for you. Please use the /feedback slash command to upload your logs, open a new bug report and post your thread ID.

etraut-openai avatar Jan 09 '26 22:01 etraut-openai

"Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again."

The only thing which worked for me (in Mint Linux) is to remove ~/.codex/auth.json and then to restart VSCode and login into ChatGPT again...

Thanks, it worked

ShiroTian avatar Jan 16 '26 09:01 ShiroTian

"Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again."

The only thing which worked for me (in Mint Linux) is to remove ~/.codex/auth.json and then to restart VSCode and login into ChatGPT again...

Thank you, this worked for MacOS

samuli-sellforte avatar Feb 02 '26 06:02 samuli-sellforte

You are probably using old version of codex. also try to signin in the terminal first, then you can use the macos app.

alik472 avatar Feb 03 '26 09:02 alik472

Still happening with codex-cli 0.98.0

jdsalasca avatar Feb 06 '26 23:02 jdsalasca

Yes, this is happening frequently to me. v0.104.0 and previous versions over the past week

BrianMcBrayer avatar Feb 18 '26 16:02 BrianMcBrayer

Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.

i2vworld avatar Apr 06 '26 10:04 i2vworld

I still encounter the same problem now.

xxlbb3274 avatar May 09 '26 03:05 xxlbb3274

I still encounter the same problem now.

is it perhaps another new issue? I haven't experienced the original issue since it was fixed back in January at least

matssk avatar May 09 '26 16:05 matssk