failed to start codex app-server

The app-server won't spawn — usually a broken binary path on Windows, a stale npm prefix, or a conflict on 127.0.0.1:9234. Work through it in order.

Last reviewed · verified against the pingdotgg/t3code repo

text
failed to start codex app-server (os error 3)

os error 3 on Windows is the system cannot find the path specified. Which is the useful clue: this is usually a path resolution failure, not a broken Codex install.

The error originates in the Codex CLI, not T3 Code — it's been reported directly against Codex too. So fix it at the Codex layer.

Step 1 — Does Codex work at all?#

bash
codex --version
codex login

If either fails, stop here. Reinstall Codex:

bash
npm i -g @openai/codex@latest

Step 2 — Find which binary is being resolved#

powershell
where.exe codex     # Windows
bash
which -a codex      # macOS / Linux

Two things to look for:

Several results. A stale shim from an old install may shadow the working one. Delete the old entry.

A path that no longer exists. Common after switching Node versions, changing your npm prefix, or moving a user directory. The shim points somewhere gone — which is precisely os error 3.

powershell
# check the npm global prefix is real
npm config get prefix
dir (npm config get prefix)

If the prefix directory is missing or wrong, reset it and reinstall:

powershell
npm config delete prefix
npm i -g @openai/codex@latest

Step 3 — Check port 9234#

Codex uses 127.0.0.1:9234 for remote connections. Reported failures occur when that port is already occupied, causing app-server bootstrap to fail.

powershell
netstat -ano | findstr :9234
taskkill /PID <pid> /F
bash
lsof -ti:9234 | xargs kill -9

More on ports →

Step 4 — Clear stale processes#

A crashed session can leave a Codex process behind that interferes with the next spawn:

powershell
tasklist | findstr codex
taskkill /PID <pid> /F
bash
ps aux | grep codex
kill -9 <pid>

Step 5 — Awkward paths#

Spawn failures cluster around paths with unusual characters. If your username, repo path or npm prefix contains non-ASCII characters, spaces in unhelpful places, or sits on a mapped network drive, try a plain local path like C:\dev\test as a diagnostic. If it works there, path handling is your culprit.

Same applies to OneDrive-redirected user folders, which introduce a reparse point where tools don't always expect one.

Step 6 — WSL boundaries#

Running the Codex CLI on the Windows side against a repository inside WSL — or the reverse — produces exactly this class of error. Keep the provider CLI, the T3 Code server and the repository on the same side of the boundary.

Windows setup guide →

Step 7 — Reinstall cleanly#

If nothing above worked:

powershell
npm uninstall -g @openai/codex
npm cache clean --force
npm i -g @openai/codex@latest
codex login

Then sign out and back in, so your desktop session picks up any PATH changes. Why that matters →

Still failing?#

Because this originates in Codex rather than T3 Code, check the Codex issue tracker as well as the T3 Code one. Include your OS, Codex version, T3 Code version and the output of where.exe codex.

FAQ#

What does "failed to start codex app-server" mean?#

The Codex CLI couldn't launch its app-server subprocess. On Windows, os error 3 means the system couldn't find the path specified, usually a stale or broken binary path rather than a missing install.

How do I fix os error 3 with Codex on Windows?#

Verify which binary resolves with where.exe codex, check that the npm global prefix directory still exists, remove stale shims, and reinstall Codex globally if the path is broken.

Is this a T3 Code bug or a Codex bug?#

It originates in the Codex CLI and has been reported directly against Codex. T3 Code surfaces it because it launches codex app-server, but the fix belongs at the Codex layer.

Could port 9234 cause this?#

Yes. Codex uses 127.0.0.1:9234 for remote connections, and app-server bootstrap can fail when another process already holds it.