Codex CLI v0.92.0 crashes on startup with ZodError (tools[5].type invalid)

Resolved 💬 9 comments Opened Jan 28, 2026 by caelum0x Closed Feb 2, 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 v0.92.0

What subscription do you have?

ChatGPT Plus (individual developer account)

Which model were you using?

gpt-5.2-codex (also reproduced with gpt-5.1 and gpt-4.1)

What platform is your computer?

_No response_

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

Terminal.app (macOS default terminal)

What issue are you seeing?

Codex CLI crashes immediately on startup with a ZodError related to tool
schema validation, even in a clean repository with no Codex configuration.

After launching codex and entering any prompt (e.g. "hi"), the session
fails with the following error:

ZodError: invalid_union
No matching discriminator
discriminator: "type"
path: ["tools", 5, "type"]

nginx
Copy code

This happens consistently on startup and makes the interactive Codex TUI
unusable.

What steps can reproduce the bug?

  1. Install Codex CLI v0.92.0 globally via npm.
  2. Navigate to any directory (including an empty or fresh repo).
  3. Run codex.
  4. Enter any prompt (e.g. hi).

Result:
The session crashes immediately with a ZodError:
path: ["tools", 5, "type"].

Notes:

  • No codex.json, .codex, .openai, or repo-level tool configuration exists.
  • Clearing caches (~/.codex, ~/.openai, ~/.config) does not help.
  • Overriding config with codex -c 'tools=[]' does not prevent the crash.
  • Switching models (gpt-5.2-codex, gpt-5.1, gpt-4.1) does not resolve the issue.
  • Non-interactive commands like codex exec and codex review work.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

9 Comments

github-actions[bot] contributor · 5 months ago

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

  • #7927
  • #9863
  • #8791

Powered by Codex Action

etraut-openai contributor · 5 months ago

Do you have any non-default config settings? For example, are you using a custom model provider defined?

This error isn't coming from the Codex harness or the Codex backend. It's likely coming from some intermediary like OpenRouter or a LLM proxy.

Also see #7721

caelum0x · 5 months ago

I am not using a custom provider or OpenRouter.
This is a clean Codex install with codex login and default config.
The same account works on Windows and fails on macOS with a Zod tool schema error, so this is a Codex CLI platform-specific bug.

caelum0x · 5 months ago

Malformed JSON in request body

etraut-openai contributor · 5 months ago

@caelum0x, if you're still able to repro this, please use /feedback to upload your logs and post the thread ID here. I'll take a look.

caelum0x · 5 months ago

codex
╭─────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.92.0) │
│ │
│ model: gpt-5.2-codex /model to change │
│ directory: ~/recoder.xyz │
╰─────────────────────────────────────────────╯

Tip: Use /status to see the current model, approvals, and token usage.

› hi

■ {"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]"}}

• Feedback uploaded. Please open an issue using the following URL:

https://github.com/openai/codex/issues/new?template=2-bug-report.yml&steps=Uploaded%20thread:%20019c1fb7-af3f-7400-b3e2-a4b591880af9

Or mention your thread ID 019c1fb7-af3f-7400-b3e2-a4b591880af9 in an existing issue.

caelum0x · 5 months ago

Repro still occurs on macOS with clean install and default config.
No custom provider, no OpenRouter.

I’ve uploaded logs via /feedback.
Thread ID: 019c1fb7-af3f-7400-b3e2-a4b591880af9

Notes:

  • Works on Windows with same account
  • Fails only in interactive TUI
  • Non-interactive commands (codex exec / review) work
etraut-openai contributor · 5 months ago

@caelum0x, the upload apparently didn't work. I don't see logs for that thread ID in our db. Do you want to try again?

One more thing for you to check: make sure you don't have OPENAI_BASE_URL env variable defined. This is sometimes used to redirect requests to a proxy or router.

etraut-openai contributor · 5 months ago

@caelum0x, I see you closed the issue. Did you resolve the problem?