Re-connecting retry's

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

What version of Codex is running?

0.4.26

What subscription do you have?

Plus

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

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.

What steps can reproduce the bug?

Just let any task to codex.

What is the expected behavior?

_No response_

Additional information

<img width="456" height="346" alt="Image" src="https://github.com/user-attachments/assets/925fc337-5e9c-4d51-b383-45514e437aa8" />

request id: 9944e1440bf99f1b-FRA

View original on GitHub ↗

49 Comments

github-actions[bot] contributor · 8 months ago

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

  • #5575
  • #5505
  • #5046
  • #5130
  • #4381

Powered by Codex Action

Meowzz95 · 8 months ago

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 · 8 months ago
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.

nick-ma · 8 months 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

thevzion · 8 months 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

same for me : exceeded retry limit, last status: 401 Unauthorized, request id: 9951233c8c203108-MRS

AlexPlom · 8 months ago

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 · 8 months ago

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 · 8 months ago

same

StefanRademakers · 8 months ago

Same issue on windows 11... can't get it to work (chatgpt plus)

mgscox · 8 months ago

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 · 8 months ago

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 contributor · 8 months ago

I think there are a couple of different issues being discussed in this thread.

  1. "401 Unauthorized" errors that go away after logout/login
  2. "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.

CrtdLunacy · 8 months ago

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.

Einhorntom · 8 months ago

It's not a flaky network issue. It's related somehow to the task history.
I have one task conversation that is stuck with this thing, but my other tasks works perfectly fine. I think it started happening in this task after I've attached a very large file

etraut-openai contributor · 8 months ago
I think it started happening in this task after I've attached a very large file

That's a really useful clue!

I'm going to reopen the issue because I think we don't yet understand the root cause.

tmeckel · 8 months ago

@etraut-openai I can definitely say that this phenomenon shows up when the OpenAI models deployed in Azure are using wire_api="responses". All models using wire_api="chat" are not affected.

https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/codex?tabs=npm

xxz7909 · 8 months ago

same issue

xxz7909 · 8 months ago

stream disconnected before completion: Transport error: Error while reading the server response: error decoding response body, request id: 99901e4559c0eb86-NRT

etraut-openai contributor · 8 months ago

Thanks for the bug report. We think we understand the cause of both the 401's and the "Re-connecting" messages, and a fix will be included in an upcoming release — most likely 0.4.37 or prerelease version 0.5.37.

illusive5943 · 8 months ago

Installation
Identifier
openai.chatgpt
Version
0.5.36
Last Updated
5 min

<img width="537" height="457" alt="Image" src="https://github.com/user-attachments/assets/8558c5ed-b06e-4a1e-902d-65a1aebf25f9" />

etraut-openai contributor · 8 months ago

@illusive5943, the fix isn't in 0.5.36 yet. Should be in the next release. ETA: tomorrow.

gmanarmaia · 8 months ago

is there any know workaround ?

tahitimoon · 8 months ago

me too. hopefully the next version will address this.

etraut-openai contributor · 8 months ago
is there any know workaround ?

Try logging out and logging back in.

gmanarmaia · 8 months ago
> is there any know workaround ? Try logging out and logging back in.

Thanks for the reply
It does not work ... tried this multiple times ... will 0.5.37 be out any time soon (with a fix)

etraut-openai contributor · 8 months ago

@gmanarmaia, if logging out doesn't clear the error for you, then 0.5.37 will not solve the problem you're seeing. I'll reopen this issue since it appears that there are multiple issues at play here.

gmanarmaia · 8 months ago
@gmanarmaia, if logging out doesn't clear the error for you, then 0.5.37 will not solve the problem you're seeing. I'll reopen this issue since it appears that there are multiple issues at play here.

thanks @etraut-openai for the response (atleast i will not be eagerly waiting for 0.5.37 now ... and hoping it will resolve my issue) ... are there any workarounds that i should try ? ... i clearing cache... logout/login... uninstall/reinstall ... anything else ?

any help is greatly appreciated !!

etraut-openai contributor · 8 months ago

@gmanarmaia, which platform are you on? The original poster in this thread is using MacOS. Are you as well?
If you suspect that this is a recent regression in the extension, you could try downgrading to earlier versions. If you find that an earlier version works, that would be a really useful clue.

gmanarmaia · 8 months ago
@gmanarmaia, which platform are you on? The original poster in this thread is using MacOS. Are you as well? If you suspect that this is a recent regression in the extension, you could try downgrading to earlier versions. If you find that an earlier version works, that would be a really useful clue.

I am on MacOS too ... do you have some suggested versions that i should try ... i can give it a shot ... i switched so many versions... so i dont know really know what i should try ... any hits will be great !

gmanarmaia · 8 months ago

@etraut-openai - i have tried going as back as 0.4.30 and many of the old and older versions no luck ... may be it is a serverside mcpserver issue ? do we have any eta on the fix version ?

Haruki-Shibuya · 8 months ago

I encountered this issue with MacOS, both Cursor and VScode extensions. Logging out and in, reinstalling, quitting the apps didn't work.

etraut-openai contributor · 8 months ago

What error do you see after the stream of Re-connecting messages? That will tell you the reason it's not able to connect.

For example, in one of the screen shots in this thread, this message reads "error sending request for url (http://localhost:60904//responses)". That means codex is trying to contact the "responses" endpoint (which is used to get responses from the model) on a localhost endpoint. This is probably due to misconfiguration in .codex/config.toml.

Haruki-Shibuya · 8 months ago

@etraut-openai
Unfortunately it's like this:

Thinking
Re-connecting... 1/5
Re-connecting... 2/5
Re-connecting... 3/5
Re-connecting... 4/5
Re-connecting... 5/5
Failed

etraut-openai contributor · 8 months ago

@Haruki-Shibuya, hmm, that error message is definitely not very helpful. Here's a thought. Do you have the Codex CLI installed on your system? Could you try running it to see if it provides a better error message in this case? The VS Code Extension is a wrapper around the CLI, and I suspect that the error message is getting dropped somewhere. If we can get a better error message, that will help us diagnose the root cause of your connection problem.

Tathanito · 8 months ago

On my end its, came after a png was badly loaded, maybe causing it to glitch forever and ruining the conversation (in my opinion)

<img width="507" height="782" alt="Image" src="https://github.com/user-attachments/assets/36727f8d-61de-44b1-9d60-47e727031785" />

unexpected status 400 Bad Request: { "error": { "message": "Invalid 'input[201].content[2].image_url'. Expected a base64-encoded data URL with an image MIME type (e.g. 'data:image/png;base64,aW1nIGJ5dGVzIGhlcmU='), but got empty base64-encoded bytes.", "type": "invalid_request_error", "param": "input[201].content[2].image_url", "code": "invalid_value" } }

scrousenator · 8 months ago

seems like I'm having the same issue. I ask a question, it says 'Thinking...', but it tries to reconnect and always ends with the error `Connection failed: error sending request for url (https://chatgpt.com/backend-api/codex/responses). I'm using v0.4.38 of the vscode codex extension (according to the extension it auto-updated '1 day ago' and yesterday I didn't have this issue) with model GPT-5-Codex. I've tried restarting vscode, logging out/logging in from the extension, and uninstalling and reinstalling the extension but see the same behavior.

<img width="278" height="210" alt="Image" src="https://github.com/user-attachments/assets/71f50325-211f-47ee-860a-aae3723afa1b" />

zhangzjjjjjj · 8 months ago

@etraut-openai same issue
On a remote server, the codex cli works fine, but when using the VS Code Codex extension, it just gets stuck on 'thinking' like in the picture.
<img width="351" height="143" alt="Image" src="https://github.com/user-attachments/assets/f6da8b94-3c17-4ce9-bdde-44c2fc6539d2" />

<img width="351" height="143" alt="Image" src="https://github.com/user-attachments/assets/233e99dc-3a84-4bc4-9ae5-aa337ef1bb72" />

CubicFX · 8 months ago
@etraut-openai same issue On a remote server, the codex cli works fine, but when using the VS Code Codex extension, it just gets stuck on 'thinking' like in the picture. <img alt="Image" width="351" height="143" src="https://private-user-images.githubusercontent.com/97730238/513063249-f6da8b94-3c17-4ce9-bdde-44c2fc6539d2.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjI5NjY2ODIsIm5iZiI6MTc2Mjk2NjM4MiwicGF0aCI6Ii85NzczMDIzOC81MTMwNjMyNDktZjZkYThiOTQtM2MxNy00Y2U5LWJkZGUtNDRjMmZjNjUzOWQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTEyVDE2NTMwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwMmFiNjhlYTJiZDNiMzhmNGU4MDllMmYzN2IxZjk1YmMyM2UxMTMyMjNlOWJiMDQ1NTdhYmMzYWU3M2FlYzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.PtKpUXBvshdr0zmx_yJKnbev14xQRdQUB4BNn2_ANb0"> <img alt="Image" width="351" height="143" src="https://private-user-images.githubusercontent.com/97730238/513145915-233e99dc-3a84-4bc4-9ae5-aa337ef1bb72.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjI5NjY2ODIsIm5iZiI6MTc2Mjk2NjM4MiwicGF0aCI6Ii85NzczMDIzOC81MTMxNDU5MTUtMjMzZTk5ZGMtM2E4NC00YmM0LTlhZTUtYWEzMzdlZjFiYjcyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTExMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUxMTEyVDE2NTMwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThkMWY3NjJkMWZhNzJkZDNhOTQ0ZjAxNzA0Mjk3NjRkNTNkN2VmNjEyYThkYmM1Nzk5YjRhNjVhZTg2ZTliYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.8jyY13UDX2no-6oW_w05Ts_aFnmWaGj5gx0DVuCz5SI">

I'm having this same error except on Arch. Logging out of codex led to denied authentication when trying to log back in. I tried to use an API key instead and it still gets hung up on "Reconnecting...".

xxz7909 · 8 months ago

Same. Usually for Code-X model buf occasionlly for gpt5

Disane · 7 months ago

I'm 🤔 having the same error. Sometimes my query goes through but mostly I get the same 5 reconnection attempts and then the response error as stated by many of the users above.

robertellisuk · 7 months ago

I'm having the same issue after switching today from user-based login to API key

scrousenator · 7 months ago

@etraut-openai just wondering, is there some diagnostic we can submit somewhere to help troubleshooting? The issue went away for me but came back for a day or two last week and then disappeared again.

lmarkusl · 7 months ago

Same issue here. Using the newest Codex CLI 0.63.0

tmeckel · 7 months ago

@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 😄

kdawgwilk · 7 months ago

~~Are any of you experiencing this issue logging into ChatGPT with SSO by chance?~~ Latest 0.72.0 fixed it for me

TheRoarkster · 7 months ago

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 contributor · 7 months ago

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.

ilmarioranen · 7 months ago

This comment in 7285 has been very helpful for me for getting past reconnecting issues

@ChrisEdwards:

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:

stream_max_retries = 40
request_max_retries = 40 
max_output_tokens = 16384
model_verbosity = "medium"

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 contributor · 6 months ago

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.