You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Codex starts any task, it performs a few steps (usually 1–3), and then it gets stuck in repeated reconnection attempts.
I’ve tried relogging, reinstalling the VS Code plugin, and using a different network connection. Everything else works fine, except Codex keeps failing to reconnect.
After reconnecting, Codex can perform a few steps, but then it gets stuck again.
I had the same issue today but in the CLI, keep getting "reconnecting" and fail with 401 error. Logout and login again fixed it
Relogging helps me for a short time.
Also, when I give Codex lightweight tasks, it works fine (not in 100%).
However, after some time, Codex starts reconnecting repeatedly and works slower than it did 1–2 weeks ago.
I ran into the same problem.
I have upgraded to v0.50.0, but the problem persists. even I performed logout/relogin, ■ exceeded retry limit, last status: 401 Unauthorized, request id: 994aada58ac0b546-LHR
Reacted by Alex, Kc, Kevin Li, Yiyang Cai, Sicheng He and yugeey x
I ran into the same problem. I have upgraded to v0.50.0, but the problem persists. even I performed logout/relogin, ■ exceeded retry limit, last status: 401 Unauthorized, request id: 994aada58ac0b546-LHR
same for me : exceeded retry limit, last status: 401 Unauthorized, request id: 9951233c8c203108-MRS
Had the same issue, logged off and logged in again and it works. However, even the browser login failed a couple of times. I believe there is some transient connectivity issue OpenAi.
same - for me this occurs irrespective of profile/ model provider - I tried logout/login and selected profiles from GPT-Plus, API, and Open-Router (both GPT-5-Codex and non-OpenAI models). Issue persisted irrespective, so seemingly not a capacity issue.
There appears to be no trigger mechanism - sometimes I get 5x retries immediately on login, sometimes whilst its running tasks
Same issue on ubuntu 24.04. Logout and login again cannot fix this reconnecting issue for me. And I found that this seldom occurs if using gpt-5 model, always occurs if using gpt-codex model
I think there are a couple of different issues being discussed in this thread.
"401 Unauthorized" errors that go away after logout/login
"Re-connecting" errors that are sporadic but persist after logout/login
We think that we understand the 401's. This problem is related to token refresh, and we think we've fixed that issue in the latest release. Please let us know if you are still seeing it.
The "Re-connecting" error is typically indicative of a flaky network connection, but we'd like to confirm that it's not a bug or infra issue on our end. If you're seeing this and do not think it's a network connectivity issue, please use the /feedback command in the CLI to report it. That will help us investigate.
Ok, ty, I’ll keep monitoring.
For the last 3 days, there have been 0 reconnects issues.
Network settings also haven’t changed, so I can’t confirm whether the issue was related to the network.
@etraut-openai I can say that when I set model_reasoning_summary = "none"codex instantly goes to reconnecting. I've deployed gpt-5.1-codex on Azure Foundry. When I remove this setting even DeepSeek-V3-0324 and DeepSeek-R1-0528 are working with codex 😄
Is this the "solution": model_reasoning_summary = "none"? Or is there going to be an update to the code? I'm still getting the constant reconnecting issue.
The Reconnecting... behavior occurs any time the codex harness receives an error from the model that is not categorized as a "fatal" error. There are dozens of underlying reasons why this can occur. If the call fails five times, codex will stop retrying and print out the error information. That error message is key to diagnosing the problem you're seeing. If you'd like additional help diagnosing the underlying problem, you can upload your logs and session information using the /feedback slash command and post your thread ID here or in a new bug report.
What I have found that helps is to set request_max_retries = 20 and max_output_tokens = 16384. This must be set in the provider section in the config.toml file.
The reason is that Azure computes reservations of tokens based on the max_output_tokens for the request. If it is not set, it assumes the largest value of the model, which is hundreds of thousands of tokens, so you run out before you actually should. Therefore, setting a smaller max_output_tokens value helps. I scanned my sessions for the max tokens I had used and set it slightly higher.
The request_max_retries helps because it is an exponential backoff, so it waits longer and longer to retry. My use case is to set Codex up in yolo mode, with full permissions, and I prompt it and let it run completely unattended. The problem is that with the default number of retries, it stops retrying and then stops running. You can queue up a bunch of continues, but it runs through them fast. With this retry value of 20, it never stops retrying before it starts succeeding again, so I don't need continue messages queued up since it won't stop till it finishes the task I gave it.
I can now use it again. I wish it gave better error messages so I could have figured out what the issue was sooner. To be clear, THE ISSUE IS INDEED TOKEN THROTTLING. I validated this by checking my Azure monitoring and saw the throttling in the metrics. This makes it usable, but still slow due to all the retries. I hope it helps.
The toml.config hacks I'm currently using with Azure OpenAI include stuff like this:
Also, getting Microsoft to increase the allowed quota/tokens per minute for deployed AI foundry models accessed in Codex to much higher than the default was required.
I'm going to close this issue because I don't think it's useful at this point. "Re-connecting retry's" covers a lot of different cases. We've addressed many of them above, but there may be some lingering ones. If you encounter a persistent "Reconnecting" message without an obvious cause (like connectivity issues), please use the /feedback command to open a new bug report.
Activity
github-actions commentedon Oct 25, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Meowzz95 commentedon Oct 26, 2025
I had the same issue today but in the CLI, keep getting "reconnecting" and fail with 401 error. Logout and login again fixed it
CrtdLunacy commentedon Oct 26, 2025
Relogging helps me for a short time.
Also, when I give Codex lightweight tasks, it works fine (not in 100%).
However, after some time, Codex starts reconnecting repeatedly and works slower than it did 1–2 weeks ago.
nick-ma commentedon Oct 26, 2025
I ran into the same problem.
I have upgraded to v0.50.0, but the problem persists. even I performed logout/relogin, ■ exceeded retry limit, last status: 401 Unauthorized, request id: 994aada58ac0b546-LHR
thevzion commentedon Oct 27, 2025
same for me : exceeded retry limit, last status: 401 Unauthorized, request id: 9951233c8c203108-MRS
AlexPlom commentedon Oct 27, 2025
Had the same issue, logged off and logged in again and it works. However, even the browser login failed a couple of times. I believe there is some transient connectivity issue OpenAi.
tonyjing1978 commentedon Oct 28, 2025
I have upgraded to v0.50.0. Had the same issue. When the connection is possible, reply to the same question multiple times, up to 5 times.
scarletkc commentedon Oct 29, 2025
same
StefanRademakers commentedon Oct 30, 2025
Same issue on windows 11... can't get it to work (chatgpt plus)
mgscox commentedon Oct 30, 2025
same - for me this occurs irrespective of profile/ model provider - I tried logout/login and selected profiles from GPT-Plus, API, and Open-Router (both GPT-5-Codex and non-OpenAI models). Issue persisted irrespective, so seemingly not a capacity issue.
There appears to be no trigger mechanism - sometimes I get 5x retries immediately on login, sometimes whilst its running tasks
Caibao7 commentedon Oct 30, 2025
Same issue on ubuntu 24.04. Logout and login again cannot fix this reconnecting issue for me. And I found that this seldom occurs if using gpt-5 model, always occurs if using gpt-codex model
etraut-openai commentedon Oct 30, 2025
I think there are a couple of different issues being discussed in this thread.
We think that we understand the 401's. This problem is related to token refresh, and we think we've fixed that issue in the latest release. Please let us know if you are still seeing it.
The "Re-connecting" error is typically indicative of a flaky network connection, but we'd like to confirm that it's not a bug or infra issue on our end. If you're seeing this and do not think it's a network connectivity issue, please use the
/feedbackcommand in the CLI to report it. That will help us investigate.CrtdLunacy commentedon Oct 30, 2025
Ok, ty, I’ll keep monitoring.
For the last 3 days, there have been 0 reconnects issues.
Network settings also haven’t changed, so I can’t confirm whether the issue was related to the network.
36 remaining items
Improved token refresh handling to address "Re-connecting" behavior (o…
lmarkusl commentedon Dec 2, 2025
Same issue here. Using the newest Codex CLI 0.63.0
tmeckel commentedon Dec 4, 2025
@etraut-openai I can say that when I set
model_reasoning_summary = "none"codexinstantly goes toreconnecting. I've deployedgpt-5.1-codexon Azure Foundry. When I remove this setting evenDeepSeek-V3-0324andDeepSeek-R1-0528are working withcodex😄kdawgwilk commentedon Dec 12, 2025
Are any of you experiencing this issue logging into ChatGPT with SSO by chance?Latest 0.72.0 fixed it for meTheRoarkster commentedon Dec 14, 2025
Is this the "solution":
model_reasoning_summary = "none"? Or is there going to be an update to the code? I'm still getting the constant reconnecting issue.etraut-openai commentedon Dec 14, 2025
The
Reconnecting...behavior occurs any time the codex harness receives an error from the model that is not categorized as a "fatal" error. There are dozens of underlying reasons why this can occur. If the call fails five times, codex will stop retrying and print out the error information. That error message is key to diagnosing the problem you're seeing. If you'd like additional help diagnosing the underlying problem, you can upload your logs and session information using the/feedbackslash command and post your thread ID here or in a new bug report.ilmarioranen commentedon Dec 14, 2025
This comment in 7285 has been very helpful for me for getting past reconnecting issues
@ChrisEdwards:
The toml.config hacks I'm currently using with Azure OpenAI include stuff like this:
Also, getting Microsoft to increase the allowed quota/tokens per minute for deployed AI foundry models accessed in Codex to much higher than the default was required.
etraut-openai commentedon Jan 13, 2026
I'm going to close this issue because I don't think it's useful at this point. "Re-connecting retry's" covers a lot of different cases. We've addressed many of them above, but there may be some lingering ones. If you encounter a persistent "Reconnecting" message without an obvious cause (like connectivity issues), please use the
/feedbackcommand to open a new bug report.