Codex CLI 0.30 Only -  stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"};

Resolved 💬 24 comments Opened Sep 5, 2025 by rwjdk Closed Sep 5, 2025
💡 Likely answer: A maintainer (dylan-hurd-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.30

Which model were you using?

gtp-5 medium

What platform is your computer?

Windows 11

What steps can reproduce the bug?

  • Install 0.30
  • run Codex
  • prompt 'hi' or any other message

What is the expected behavior?

That Codex answer back or begin coding

What do you see instead?

You get this:

***

▌hi

⚠️ stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 1/5 in 193ms…

⚠️ stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 2/5 in 373ms…

⚠️ stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 3/5 in 776ms…

⚠️ stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 4/5 in 1.718s…

⚠️ stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 5/5 in 2.91s…

🖐  unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}

Additional information

  • Installed from the download as not ready on npm yet
  • Error happens both in normal Windows and WSL

View original on GitHub ↗

24 Comments

himomohi · 10 months ago

same

SystemSculpt · 10 months ago

Same here

<img width="762" height="436" alt="Image" src="https://github.com/user-attachments/assets/894201ca-9378-4559-aadf-f259db3bbbf3" />

adv0cat · 10 months ago

Same on Mac OS after update by npm i -g @openai/codex
P.s. It's solved! 🎉🎉🎉

<img width="859" height="557" alt="Image" src="https://github.com/user-attachments/assets/0135b887-5c03-4e06-ada2-a7f63133e63b" />

rwjdk · 10 months ago
Same on Mac OS after update by npm i -g @openai/codex

Seems we have a FUBAR build on both Windows and Mac... So at least we will properly get a quick fix...

Thsandorh · 10 months ago

same here

ben-vargas · 10 months ago

Yep, same issue here. They've probably broken the system instruction the backend API validates on requests.

diezep · 10 months ago

Seems specific to 0.30.0, while a fix arrives (or update on OpenAI endpoints), workaround is going back to version 0.29.0:
npm install -g @openai/codex@0.29.0

sashd3 · 10 months ago

same here

ben-vargas · 10 months ago

Likely broken by https://github.com/openai/codex/pull/3122 where they modified prompt.md which is strictly validated by the backend endpoints to validate Plus/Pro subscriber use through codex cli.

rwjdk · 10 months ago

Tried to delete my Agent.md but did not resolve, so it is not our Instructions that are invalid

Ixe1 · 10 months ago

Same here.

s0lana69 · 10 months ago

same

Alfredo-Sandoval · 10 months ago

+1 on linux

diezep · 10 months ago

Seems OpenAI endpoits have been changed. It's fixed at 0.30.0.

himomohi · 10 months ago

It's solved. Everyone, try again

dylan-hurd-oai contributor · 10 months ago

Hi folks - this should be fixed. Please let us know if you're still hitting errors!

ben-vargas · 10 months ago

Confirmed fixed for me.

akkinra · 10 months ago

I see this issue after updating it to CLI 0.36.0 on Linux

mgscox · 9 months ago

similar - codex-cli 0.41.0

tream error: unexpected status 400 Bad Request: {
  "error": {
    "message": "The encrypted content gAAA...o4o= could not be verified.",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}; retrying 1/5 in 194ms…
syshex · 9 months ago

Yes, getting the same as @mgscox . This happens when I use openai api key for the requests.

unexpected status 400 Bad Request: {
  "error": {
    "message": "The encrypted content gAAA...3bk= could not be verified.",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
ben-vargas · 9 months ago

This issue is closed and those are different 400 errors than this issue was reporting.

The cause on this issue was at 0.30.0 release the system prompt changed and the chatgpt.com/backend-api/codex/responses validates the Codex CLI system prompt - the mismatch was causing 400 rejection with {"detail":"Instructions are not valid"} message.

You guys are reporting 400 errors, but totally different error message - probably best to create a separate issue if you've not already done so.

ollieatkinson · 9 months ago

If you have a plus subscription and re-auth using api-key (or another authentication) you cannot resume the conversation you must start a new one. I can only assume the prior auth-keys are in the headers somewhere which now conflicts with the new ones. I had this exact problem when I ran out of tokens and switched to API billing.

profpauloetec · 7 months ago

Resolvi o problema apagando a pasta .codex e reinstalando a extensão

joej · 7 months ago
> Same on Mac OS after update by npm i -g @openai/codex Seems we have a FUBAR build on both Windows and Mac... So at least we will properly get a quick fix...

Same
I've tried multiple times over the past month or two -- recreating API keys, reinstalling codex (brew install and with npm), watching it fail every time ... every damned time.

Never -not once - has codex ever run on my mac.

This is as best it gets:
unexpected status 400 Bad Request: {"success":false,"error":
{"name":"ZodError","message":"[\n {\n \"code\": \"invalid_union\",
\n \"errors\": [],\n \"note\": \"No matching discriminator\",\n
\"discriminator\": \"type\",\n \"path\": [\n \"tools\",\n 5,\n
\"type\"\n ],\n \"message\": \"Invalid input\"\n }\n]"}}