"Bad request" error

Open 💬 22 comments Opened Feb 4, 2026 by atomical
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.94.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.2 xhigh

What platform is your computer?

Darwin 25.1.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Terminal.app

What issue are you seeing?

{"detail":"Bad Request"}

This continues to happen after 30+ minutes when I send a prompt. I have 39% context left. It's unrecoverable and generates the same error if I send "continue."

thread ID: 019c2394-2e58-7eb0-98e7-978424cb4745

What steps can reproduce the bug?

Seems specific to a larger project that requires a lot of reasoning to move forward. I haven't seen it in other sessions.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

22 Comments

github-actions[bot] contributor · 5 months ago

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

  • #10343

Powered by Codex Action

pardeike · 5 months ago

I understand the wish to not duplicate issues but I am having this issue and #10343 is closed. So here is my feedback on it. Current situation is hardly useable for longer tasks: https://github.com/openai/codex/issues/10343#issuecomment-3877198157

pardeike · 5 months ago

Update. Here is a good example:

<img width="854" height="685" alt="Image" src="https://github.com/user-attachments/assets/c09f33f3-9fc4-4699-94e3-506319cead15" />

ryanc-cf · 4 months ago

Getting {"detail":"Bad Request"} on almost every single request/reply. What the hell is causing this? Codex is almost unusable because this error shows up so often.

etraut-openai contributor · 4 months ago

@ryanc-cf, please use /feedback to upload your logs and session details and post your thread ID here. That will allow us to investigate.

ryanc-cf · 4 months ago

<img width="3790" height="1615" alt="Image" src="https://github.com/user-attachments/assets/529396b9-45a1-4e4b-867a-cd7fe749ed40" />

ryanc-cf · 4 months ago

@etraut-openai See here, 3x in a row :/ https://github.com/openai/codex/issues/12477

BBARLOCCO · 4 months ago

@etraut-openai I've been seeing this error over and over, from the Codex app. I believe that it's related to having a big context several times "compressed", at some point, something breaks and it faces the bad request error very fast (even if not directly, like after a few messages.
If I start a new chat session, I don't see the problem for a long time

etraut-openai contributor · 4 months ago

If you see this, please use the /feedback slash command to upload your logs and session details, then post the thread ID here.

BBARLOCCO · 4 months ago

here's one @etraut-openai 019c81c3-1821-73c3-9523-5a976caf5200

ryanc-cf · 4 months ago

@etraut-openai I think BBARLOCCO is right, I tried making a new session and it didnt work for me. But I do recall it compacting the session lots of times and then eventually these errors started showing up. The fix for me was to actually delete ~/.codex completely and start over. For some reason starting a new session wouldnt fix it for me. But I do suspect it's multiple compactions that are the problem child. It got to a point where compacting would result in about 37% free when it should have been closer to 90-98% I think. So it's summary was super long. Perhaps the fix is to put a limit on how long the summary can be?

etraut-openai contributor · 4 months ago

Thanks @ryanc-cf. I think we have the details we need to identify the specific failures in our back-end logs. We're exploring a couple of working theories and trying to root cause.

ansalls · 4 months ago

Haven't tried clearing the folder yet, but I'm having the same issue. Also have a very long summary that's taking up around 75% of the context window.

kalleh · 4 months ago
It appears to be correlated with unusually long sessions and user prompts.

My session is not particularly long and neither are the prompts

019c8bf9-8ec0-7b12-9ded-e32ecaab5668

etraut-openai contributor · 4 months ago

@kalleh, the rollout you uploaded is very long. It's over 100MB and contains well over 10,000 items.

derekroetzel · 4 months ago

@etraut-openai I was invited to test the new Codex for Windows app. After installing it, I started to receive {"detail":"Bad Request"} errors on each session, generally within 10 minutes into execution. The errors have been occurring in both the new Codex for Windows app and the Codex VS Code extension. I thought it might be a conflict between the two, so I uninstalled both as well as VS Code. I deleted every file I could find related to Codex or VS Code from my pc. I reinstalled VS Code and the Codex extension. The error has not gone away.

019ca095-6396-7082-8d4b-aa83afcf1be6

--
UPDATE: In order to get moving again, I switched to WSL. It appears to have eliminated the issues. On the Codex Extension in VS Code, I clicked the gear icon in the upper right corner, then "Windows Settings" > "Run in WSL". This is not a direct "fix" per-se but seems to have gotten Codex working again for me.

ReidGarland · 4 months ago

thread ID 019cb071-37bc-79c0-81e4-7020e72bbf0d

codex cli on ubuntu

stefanwiele · 3 months ago

019d2080-1aee-7db2-a066-ec3e4fb4cf94 on every request codex gui on MacOs

juansalvatore · 2 months ago

getting this error on gpt 5.4 and 5.5 on multiple agent chats
Thread id example: 019db8a5-9754-7c62-b0ab-9cf80011d1bf
Plan: pro x2
Mac OS, using the desktop codex app.
Seems like the agent thread gets corrupted, tried forking the thread to see if that helped but had the same error on every message or almost every message. It felt like usually after calling a bash read or some tool/mcp. But not sure sometimes it happened just responding.
Copying the thread id and continuing with the same model and config in a separate chat worked with no issues

JustFly1984 · 1 month ago

getting{"detail":"Bad Request"} error in codex since today, breakig the /goal flow. gpt 5.5 high

NellInc · 6 days ago

Getting this again now in the latest Codex! Come on!!!!

JustFly1984 · 6 days ago

I'm getting {"detail":"Bad Request"} every time I'm trying to make codex to work with e2e screenshot testing - looks like it chokes