Can't use Codex 5.2
Resolved 💬 17 comments Opened Jan 12, 2026 by rdbnotebook Closed Jan 17, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.80.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.2-codex xhigh
What platform is your computer?
mac
What issue are you seeing?
unexpected status 502 Bad Gateway: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
, request id: 9bce00102e7d6c7a-DFW
---
Persistent issue all day yesterday Sun Jan 11, and today Mon Jan 12.
What steps can reproduce the bug?
thread ID 019bb270-3c0e-7320-bd8c-3a03c2ab46b9
What is the expected behavior?
Responses rather than 402 errors
Additional information
_No response_
17 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Reopening because this doesn't look like a duplicate of #9094.
This looks like #8944, which we never root caused.
@rdbnotebook, are you able to repro this consistently, or was it a one-time problem?
The error in this case is coming from the CloudFlare gateway, not from OpenAI's servers.
Yes consistently for both gpt-5.2-codex and gpt-5.2 (yesterday and this morning). Started using gpt-5.1-codex-max as fallback this morning and so far no repo there.
Just saw a similar 502 come through in the thinking on 5.1-codex-max (1/5 tries) but then it recovered and is continuing with the request (unlike with the 5.2 models which error repeatedly after 5/5 tries 502s, never able to provide a response after the first request, though they typically provide a first reply after restarting codex and logining-out / back-in to refresh cache). Have had these 502 5/5 errors occur about 8-10 times over the past 2 days such that I've not been able to use 5.2 at all).
Update: gpt-5.1-codex-max has been stuck in a considering/planning loop for the past 2 hours (expect it may be hitting a similar error).
@rdbnotebook, I see that you attempted to upload logs using
/feedback. Apparently, they didn't come through because I don't see that log in our system. If you see the 502 issue again, could you please use/feedbackagain to upload the logs and then post the new thread ID here?You're currently the only user (to our knowledge) who is reporting this 502 issue, but we did receive a separate report of this a few days ago.
thread ID 019bb270-3c0e-7320-bd8c-3a03c2ab46b9
(from this morning / yesterday)
Also switched models in the 5.1 terminal with the 2hr thinking/planning loop that I mentioned back to 5.2 and it repo-ed the issue as well:
thread ID 019bb329-5be6-7912-a872-a7dc14abb129
Unfortunately, none of those logs are coming through. I'm guessing that there's some connectivity issue that's related to your 502 issue. Do you have a corporate firewall or are you using a VPN or LLM proxy that might be intercepting your requests?
Nope. My own mac studio machine running on home fiber, no firewall or vpn, running codex directly in the terminal (don't even have it running in my IDE). Have been using codex cli (pro account) as my regular cli coding assistant for the past 5 months since some of the more recent upgrades, has always worked great until yesterday (running the same way on the same machine). My (limited) understanding of a 502 error is that it occurs when Cloudflare tries to connect to the hosting server but receives an invalid response, so seems like it's openai server side (or something in between)? Based in Austin, TX and looks like the routing is going through a cloudflare point at DFW from the error code (request id: 9bcd3f53fce746d7-DFW).
Thanks for the details.
We just received another report of this same behavior from a user in Toronto.
Let me know if I can provide anything log-wise helpful directly through a secure channel.
Below is a non-sensitive excerpt in case helpful from .codex/log/codex-tui.log
...
2026-01-12T14:05:48.519869Z WARN codex_core::codex: stream disconnected - retrying turn (1/5 in 189ms)...
2026-01-12T14:07:07.000521Z WARN codex_core::codex: stream disconnected - retrying turn (2/5 in 427ms)...
2026-01-12T14:08:25.896438Z WARN codex_core::codex: stream disconnected - retrying turn (3/5 in 773ms)...
2026-01-12T14:09:45.102979Z WARN codex_core::codex: stream disconnected - retrying turn (4/5 in 1.72s)...
2026-01-12T14:11:05.236329Z WARN codex_core::codex: stream disconnected - retrying turn (5/5 in 2.898s)...
2026-01-12T14:12:26.451065Z INFO codex_core::codex: Turn error: unexpected status 502 Bad Gateway: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
, request id: 9bcd3f53fce746d7-DFW
2026-01-12T14:28:46.578340Z WARN codex_core::codex: stream disconnected - retrying turn (1/5 in 180ms)...
2026-01-12T14:30:05.033681Z WARN codex_core::codex: stream disconnected - retrying turn (2/5 in 372ms)...
2026-01-12T14:31:23.983592Z WARN codex_core::codex: stream disconnected - retrying turn (3/5 in 792ms)...
2026-01-12T14:32:43.084347Z WARN codex_core::codex: stream disconnected - retrying turn (4/5 in 1.754s)...
2026-01-12T14:34:03.333988Z WARN codex_core::codex: stream disconnected - retrying turn (5/5 in 3.489s)...
2026-01-12T14:35:25.359617Z INFO codex_core::codex: Turn error: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)
2026-01-12T14:49:31.976405Z WARN codex_core::codex: stream disconnected - retrying turn (1/5 in 181ms)...
2026-01-12T14:50:50.702196Z WARN codex_core::codex: stream disconnected - retrying turn (2/5 in 366ms)...
2026-01-12T14:52:09.502881Z WARN codex_core::codex: stream disconnected - retrying turn (3/5 in 760ms)...
2026-01-12T14:53:28.618221Z WARN codex_core::codex: stream disconnected - retrying turn (4/5 in 1.73s)...
2026-01-12T14:54:48.798313Z WARN codex_core::codex: stream disconnected - retrying turn (5/5 in 3.4s)...
2026-01-12T14:56:10.738534Z INFO codex_core::codex: Turn error: unexpected status 502 Bad Gateway: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
, request id: 9bcd7f65ac716b38-DFW
2026-01-12T16:17:22.729042Z WARN codex_core::codex: stream disconnected - retrying turn (1/5 in 189ms)...
2026-01-12T16:18:41.416443Z WARN codex_core::codex: stream disconnected - retrying turn (2/5 in 389ms)...
2026-01-12T16:20:00.204279Z WARN codex_core::codex: stream disconnected - retrying turn (3/5 in 789ms)...
2026-01-12T16:21:19.559712Z WARN codex_core::codex: stream disconnected - retrying turn (4/5 in 1.675s)...
2026-01-12T16:22:39.688312Z WARN codex_core::codex: stream disconnected - retrying turn (5/5 in 2.885s)...
2026-01-12T16:24:00.943690Z INFO codex_core::codex: Turn error: unexpected status 502 Bad Gateway: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
, request id: 9bce00102e7d6c7a-DFW
...
2026-01-12T19:54:09.687974Z WARN codex_core::codex: stream disconnected - retrying turn (1/5 in 195ms)...
2026-01-12T19:55:28.373038Z WARN codex_core::codex: stream disconnected - retrying turn (2/5 in 409ms)...
2026-01-12T19:56:47.211235Z WARN codex_core::codex: stream disconnected - retrying turn (3/5 in 812ms)...
2026-01-12T19:58:06.356520Z WARN codex_core::codex: stream disconnected - retrying turn (4/5 in 1.491s)...
2026-01-12T19:59:26.364598Z WARN codex_core::codex: stream disconnected - retrying turn (5/5 in 3.359s)...
2026-01-12T20:00:48.052922Z INFO codex_core::codex: Turn error: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)
So powered down all machines using codex, and powered down the router and the fiber ont modem, then restarted everything and so far 5.2 is working again. Could be that I'm getting routed through another cloudfare point or could have been something specific to my network (though hard to see that causing 502s and it occurring for other uses intermittently as well). In any case happy to close the the issue or leave up, let me know.
Thanks for the update. I'm glad to hear things are working for you again!
We're still working on some theories on our end. And at least one other user has reported this issue.
Let's leave the issue open for now.
Encountering similar issues also with VS Code Extension - probably related. The extension is almost unusable today.
Happy to provide further logs / etc if it helps (sent already via
/feedback, id:019ba36c-e2f4-7261-96d2-7ef7d1cd3224
)Details:
VS Code;uname -mprs:Darwin 25.1.0 arm64 armmodel = "gpt-5.2-codex"model_reasoning_effort = "xhigh"In the codex pane, mostly seeing something like this:
/Users/admin/Library/Application Support/Code/.../openai.chatgpt/Codex.logcontains something like this:<details><summary>Excerpt from the log</summary>
</details>
Apologies if you are affected by this issue. We continue to get a smattering of reports of this, but we're struggling to pin down the cause because 1) it seems to be happening to a very small number of users, 2) we're not seeing any evidence of it in our backend systems, and 3) users who hit this are unable to upload their logs using
/feedback.We suspect it's related to our Cloudflare gateway, but we need some additional clues to pin it down.
If you are experiencing this, here's how you can help us out:
npm i -g @openai/codex@0.82.0-alpha.2(note the dash: -alpha.2)
export RUST_LOG="warn,codex=trace"~/.codex/log/codex-tui.logand search for 502. On that line, find "headers={" and copy the HTTP headers.Important:
Also tell us:
This will let us correlate Cloudflare failures on their side.
Closing for lack of response.