查看中文版 →

Deutsche Version ansehen →

Открыть русскую версию →

Ver versión en español →

Log in
Blog · Setup guides

Fix Codex "could not start its user interface" and missing CLI binary

When Codex hangs for 30 seconds in VS Code or Cursor before failing to load its sidebar, or when the desktop app cannot find the CLI binary, the fix depends on which layer broke. Here are the verified commands for macOS, Linux, Windows, and WSL2.

Two startup errors account for most Codex setup failures across VS Code, Cursor, and the Windows desktop app. They often show up on the same machine after an update, but they come from different layers: one is a sidebar webview timeout inside the editor, and the other is a missing or unresolvable CLI executable.

Codex could not start.The extension could not start its user interface.

In the extension output log, that UI error corresponds to a hardcoded 30-second timeout:

[CodexWebviewProvider] Webview renderer did not become ready... reason=renderer_ready_timeout (timeoutMs=30000)

The second error appears in the desktop app or CLI-backed integrations when the host cannot locate the native executable:

Unable to locate the Codex CLI binary.Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex

Fastest fixes: For The extension could not start its user interface, update OpenAI.chatgpt to 26.1106.51428 or later (or roll back to 26.1007.21434) and clear the editor's Service Worker cache. For Unable to locate the Codex CLI binary, reinstall @openai/codex with optional dependencies enabled, or point CODEX_CLI_PATH directly to the native codex.exe / codex binary.

Symptom, cause, and fix matrix

Match your environment and error message below, then jump straight to the matching steps.

Codex startup errors mapped by symptom, root cause, and fastest fix
Symptom and environmentRoot causeFastest fix
VS Code or Cursor throws could not start its user interface after an update30-second webview timeout regression (renderer_ready_timeout) in 26.1021.x buildsUpdate to 26.1106.51428+ or roll back to 26.1007.21434 and pause auto-update
Same UI error persists on macOS or Windows after changing versionsStale Service Worker or WebStorage cache blocks webview bootstrapQuit the editor completely, delete Service Worker and WebStorage, then relaunch
UI error happens only in Cursor or custom sidebar layoutsSecondary sidebar container conflicts with the extension webviewRun Codex: New Codex Agent from the Command Palette to open it as an editor tab
30-second timeout inside a WSL2 workspaceHanging WSL local sockets or heavy workspace initialization stalls the webview handshakeRun wsl --shutdown in PowerShell, relaunch the editor, and reload the window
Windows Store desktop app shows Unable to locate the Codex CLI binaryApp was moved to D: or E:, breaking MSIX relative paths to bundled binariesMove the app back to C: via Windows Settings → Apps → Installed apps
Desktop app or extension still cannot find codexBinary path is missing or points to a .cmd wrapper (triggering spawn EINVAL)Set CODEX_CLI_PATH or chatgpt.cliExecutable to the native binary
npm installation fails to locate platform binaryOptional dependencies were skipped during install, or global npm bin is missing from PATHRun npm install -g @openai/codex --include=optional and check PATH

Fixing "The extension could not start its user interface"

This message does not mean your OpenAI account or network connection is broken. As tracked in openai/codex GitHub issues (#56655, #56691, #57032), the backend app-server starts normally, while the sidebar webview fails to report ready before the 30-second renderer_ready_timeout fires.

1. Update to a patched build, or roll back to a known stable version

OpenAI shipped a fix for the 26.1021.x startup regression in stable version 26.1106.51428 (and pre-release 26.51106.51428). Check for extension updates first, then open the Command Palette (Cmd + Shift + P on macOS, Ctrl + Shift + P on Windows/Linux) and run Developer: Reload Window.

If your marketplace feed has not picked up the patched release yet, pin the known working 26.1007.21434 build from your terminal:

code --uninstall-extension OpenAI.chatgptcode --install-extension [email protected] --force

In Cursor, replace code with cursor. After rolling back, pause auto-updates so the editor does not immediately overwrite the pinned version on restart. You can right-click the extension and uncheck Auto Update, or add this to settings.json:

{  "extensions.autoUpdate": false}

2. Clear the editor webview and Service Worker cache

Old Service Worker scripts often survive extension reinstalls and keep triggering renderer_ready_timeout even after an upgrade. Quit VS Code or Cursor completely before clearing the cache directories.

macOS (for Cursor, replace Code with Cursor):

rm -rf "$HOME/Library/Application Support/Code/Service Worker"rm -rf "$HOME/Library/Application Support/Code/WebStorage"

Linux:

rm -rf "$HOME/.config/Code/Service Worker"rm -rf "$HOME/.config/Code/WebStorage"

Windows PowerShell (for Cursor, replace Code with Cursor):

Remove-Item -Recurse -Force "$env:APPDATA\Code\Service Worker" -ErrorAction SilentlyContinueRemove-Item -Recurse -Force "$env:APPDATA\Code\WebStorage" -ErrorAction SilentlyContinueRemove-Item -Recurse -Force "$env:APPDATA\Code\CachedExtensionVSIXs" -ErrorAction SilentlyContinue

Relaunch the editor. It will regenerate clean webview storage without touching your projects or saved settings.

3. Work around Cursor sidebar conflicts and WSL2 timeouts

In Cursor or customized VS Code layouts, the secondary sidebar container can block the extension view from mounting. Bypass the sidebar by opening the Command Palette and running:

Codex: New Codex Agent

This opens Codex inside a regular editor tab instead of the sidebar panel. You can drag the tab into a split pane next to your code.

If the 30-second timeout only occurs when attached to a WSL2 workspace, reset the WSL instance from Windows PowerShell to clear hanging sockets:

wsl --shutdown

Then reopen the editor and reconnect to WSL.

Fixing "Unable to locate the Codex CLI binary"

This error means the desktop app or IDE extension cannot find or execute the underlying native codex / codex.exe binary. Work through the four checks below.

1. Reinstall @openai/codex with optional dependencies and verify PATH

@openai/codex distributes its platform-specific native binaries through optional dependencies. If your package manager skipped optional packages, the wrapper installs without the actual binary. Run a clean reinstall:

npm uninstall -g @openai/codexnpm install -g @openai/codex --include=optional

Verify that your global npm bin directory is on PATH and resolves the binary:

npm config get prefixwhich codex

On Windows PowerShell, run where.exe codex. If the prefix directory (typically %APPDATA%\npm on Windows, or /usr/local/bin / your nvm bin folder on macOS and Linux) is missing from PATH, add it and restart your terminal.

2. Set CODEX_CLI_PATH to the native binary

If the desktop app still cannot find its bundled bin/codex after an update, override the lookup explicitly with CODEX_CLI_PATH.

On Windows, do not point CODEX_CLI_PATH to %APPDATA%\npm\codex.cmd. Electron throws spawn EINVAL when spawning a .cmd wrapper directly. Point it to the underlying native .exe binary instead:

$nativeBin = "$env:APPDATA\npm\node_modules\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\bin\codex.exe"[Environment]::SetEnvironmentVariable("CODEX_CLI_PATH", $nativeBin, "User")

Sign out and back in (or reboot Windows) so the desktop app picks up the updated user environment variable.

On macOS or Linux, add the export to ~/.zshrc or ~/.bashrc:

export CODEX_CLI_PATH="$(which codex)"

3. Check chatgpt.cliExecutable and WSL settings in settings.json

When only the VS Code or Cursor extension fails to locate the binary, set the explicit path in settings.json:

{  "chatgpt.cliExecutable": "/usr/local/bin/codex"}

If you run native Windows without WSL and hit this error after an update, check both VS Code settings and %USERPROFILE%\.codex\config.toml to ensure WSL routing is not accidentally enabled:

{  "chatgpt.runCodexInWindowsSubsystemForLinux": false}

If you intentionally run Codex inside WSL2, leave that setting as true and confirm codex --version works inside your WSL shell.

4. Move the Windows Store desktop app back to C:

Microsoft Store (MSIX) installations moved to a secondary drive such as D: or E: often lose relative path resolution to their bundled binaries. Open Windows Settings → Apps → Installed apps, find ChatGPT / Codex, open its menu, select Move, and relocate it back to C:.

Keep shipping in the terminal if the IDE sidebar stays broken

The IDE extension is a webview wrapper around the Codex CLI. Even when an editor update breaks the sidebar panel, running codex directly in your terminal bypasses the webview timeout completely.

If you want to run Codex CLI alongside other frontier coding models under one subscription, check the Codex setup guide. With CodingPass, the Go plan starts at $10 a month, gives you access to all models from one account, and lets you compare every tier on the pricing page and usage limits reference.

FAQ

Why does setting CODEX_CLI_PATH on Windows cause spawn EINVAL?

Because the variable points to the codex.cmd shim rather than the native codex.exe binary. Update CODEX_CLI_PATH to the .exe inside @openai/codex-win32-x64\vendor\x86_64-pc-windows-msvc\bin\codex.exe and restart the app.

Can VS Code Settings Sync break Codex across macOS and Windows?

Yes. Hardcoding an OS-specific absolute path in chatgpt.cliExecutable syncs that path to your other machine, where it does not exist. Either exclude chatgpt.cliExecutable from Settings Sync or set it per workspace instead of globally.

If the extension hits renderer_ready_timeout, is the codex CLI broken too?

No. renderer_ready_timeout happens strictly inside the VS Code or Cursor webview host. You can open a terminal in your repository and run codex directly while waiting for an extension patch.

Boarding

Sidebar stuck, terminal still works.

Codex CLI runs directly in your terminal without the IDE webview. Connect it to CodingPass starting at $10 a month and cancel anytime.

  • Request ID on every response
  • Full refund if you've used 5% or less
  • No surprise charges
Choose GoCodex guide

$10/mo until you cancel.