Skip to content

Re-connecting retry's #5679

Closed
Closed

Description

@CrtdLunacy

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

Image

request id: 9944e1440bf99f1b-FRA

Activity

  1. Meowzz95 commented on Oct 26, 2025

    @Meowzz95

    I had the same issue today but in the CLI, keep getting "reconnecting" and fail with 401 error. Logout and login again fixed it

  2. CrtdLunacy commented on Oct 26, 2025

    @CrtdLunacy
    Author

    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.

  3. nick-ma commented on Oct 26, 2025

    @nick-ma

    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

  4. thevzion commented on Oct 27, 2025

    @thevzion

    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

  5. AlexPlom commented on Oct 27, 2025

    @AlexPlom

    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.

  6. tonyjing1978 commented on Oct 28, 2025

    @tonyjing1978

    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.

  7. scarletkc commented on Oct 29, 2025

    @scarletkc

    same

  8. StefanRademakers commented on Oct 30, 2025

    @StefanRademakers

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

  9. mgscox commented on Oct 30, 2025

    @mgscox

    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

  10. Caibao7 commented on Oct 30, 2025

    @Caibao7

    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

  11. etraut-openai commented on Oct 30, 2025

    @etraut-openai
    Contributor

    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.

  12. CrtdLunacy commented on Oct 30, 2025

    @CrtdLunacy
    Author

    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.

  13. 36 remaining items

  14. added
    agentIssues related to the core agent loop
    and removed
    extensionIssues related to the VS Code extension
    on Dec 1, 2025
  15. lmarkusl commented on Dec 2, 2025

    @lmarkusl

    Same issue here. Using the newest Codex CLI 0.63.0

  16. tmeckel commented on Dec 4, 2025

    @tmeckel

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

  17. kdawgwilk commented on Dec 12, 2025

    @kdawgwilk

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

  18. TheRoarkster commented on Dec 14, 2025

    @TheRoarkster

    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.

  19. etraut-openai commented on Dec 14, 2025

    @etraut-openai
    Contributor

    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.

  20. ilmarioranen commented on Dec 14, 2025

    @ilmarioranen

    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.

  21. etraut-openai commented on Jan 13, 2026

    @etraut-openai
    Contributor

    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.

  22. added
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    and removed
    agentIssues related to the core agent loop
    on Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions