Skip to content

Kingy / AI Fix Finder

← All fixes

Codex "os error 32": how to fix the Windows sandbox error

Check this fix ↓

Codex fails with os error 32 and "setup refresh had errors" on Windows? A sandbox bug fixed in CLI 0.163.0. How to update, check and work around it.

sourced Checked 2026-11-06

Which "os error 32" do you have?

The same number means two unrelated things:

  • On Windows: error 32 means a file is in use by another process. Most Codex reports since October 7, 2026 come from a sandbox setup bug that was fixed in Codex CLI 0.163.0. Newer app builds have a related error too. Jump to the Windows fix.
  • On macOS or Linux: error 32 means "Broken pipe": a connection closed while Codex was still writing to it. See that section.

Windows: fix it

  1. Update the desktop app. On Windows, Codex runs in the ChatGPT desktop app from the Microsoft Store. Update it to version 26.1007.21434 or later: check the version on the app's About screen, and get updates from the Microsoft Store. The Store may show a different package number for the same release (26.1007.2314.0).
  2. Update the standalone CLI too, if you use one. Check with codex --version, and update it to 0.163.0 or later the same way you installed it (for example, with npm). If it shows 0.162.0-alpha.17.2, that's the CLI bundled with the fixed app, and it already has the fix.
  3. Fully quit Codex and open it again, so the update is loaded. Restarting alone doesn't fix it; this restart just loads the new version.
  4. Check it worked: ask Codex to run a real command, such as Get-Location. It should run, with no "setup refresh had errors" message. A prompt that only gets a text reply doesn't test the sandbox.

Status:

  • Fixed in Codex CLI 0.163.0: OpenAI's release notes, October 15, 2026.
  • Desktop app: six users report that 26.1007.21434 fixed it. OpenAI hasn't named an app version, and the main GitHub issues are still open.
  • How this page was made: Kingy can't reproduce this on its Mac, so this page is Sourced. It comes from OpenAI's release notes, code change and docs, and from user reports that name versions.

What you see

In the app, VS Code or the CLI, commands fail before they start, with messages like:

  • helper_unknown_error: setup refresh had errors
  • Failed to create unified exec process: helper_unknown_error: setup refresh had errors
  • windows sandbox failed: helper_unknown_error: setup refresh had errors
  • Browser or computer use: trusted Node process exited unexpectedly; kernel reset, rerun your request

The sandbox log names the real problem. You'll find it in %USERPROFILE%\.codex\.sandbox\. It says a file is being used by another process. (os error 32), and points at Codex's own running files, such as node_repl.exe, node.exe or VCRUNTIME140_1.dll.

A log line ending (os error 32); continuing setup is a warning, not the failure. Users report it stays even after the fix.

Why it happened

Before running a command, Codex's Windows sandbox checks the permissions on its own runtime files. In app builds 26.1002.x, and in CLI 0.161.0, 0.162.0, 0.162.1 and early 0.162.0 alphas such as alpha.2 (first reported October 7, 2026), it opened those files with broader access than it needed. Windows refuses that kind of request for program files (EXE and DLL files) that are running, and Codex's helper programs were running. So the check failed, and every command failed with it.

OpenAI's fix (pull request #51822, merged October 7, 2026) asks Windows only for the access it needs. The release notes for CLI 0.163.0 list it.

Affected versions (reported by users):

  • ChatGPT/Codex desktop app 26.1002.51308 and 26.1002.52244.
  • VS Code extension 26.1002.51308.
  • CLI 0.161.0, 0.162.0-alpha.2, 0.162.0 and 0.162.1.
  • Reports came from Windows 10 22H2 through Windows 11 25H2, including ARM64.

Kingy checked OpenAI's release tags: 0.162.0 and 0.162.1 don't contain the fix, and 0.163.0 does.

Still failing after the update?

Users report three causes:

  • An old CLI is still in use.

    • If you installed codex with npm, update it to 0.163.0 or later (check with codex --version).
    • Some users found the app's own background helper still at 0.162.1 after updating the app. The sandbox log's "spawning" line shows which helper ran. We found no documented way to update that helper by hand.
  • An old helper path in two config files. One user found CODEX_CLI_PATH still pointing at an old CLI in two places:

    • config.toml, under [mcp_servers.node_repl.env]
    • the bundled unified-computer-use plugin's .mcp.json

    Changing both to the current CLI and restarting Codex fixed it. This is a single report, and the user says a Codex update may undo it.

  • A different error with the same number. Newer app builds (26.1013 to 26.1023) can fail with CreateProcessSecurityEnvironment failed (HRESULT = 0x80070020). That's error 32 in another form, from Codex's newer MXC sandbox.

    • Users were still reporting it on November 5, 2026.
    • There's no known cause or fix yet, and updating to CLI 0.163.0 isn't reported to fix it.
    • Users report that a separately installed Codex CLI could still run commands while the app failed.

If only browser use still fails after updating (trusted Node process exited unexpectedly):

  1. Check the sandbox log for os error 32 first.
  2. If it's there, see the CODEX_CLI_PATH case above. In that user's report, only browser and computer use were still failing.
  3. If it isn't, one user traced a browser-only failure to a separate bug (#54447). That's a single report.

Stopgap, if you can't update yet

The update is the real fix. Use this only for a short time.

Switch the sandbox to unelevated:

  1. Open %USERPROFILE%\.codex\config.toml in Notepad. When you save, choose "All files" as the type, so Notepad doesn't save it as config.toml.txt.

  2. Add the setting:

    • If the file already has a [windows] section with a sandbox line, change that line to sandbox = "unelevated".
    • If it has a [windows] section but no sandbox line, add the line under it.
    • If it has no [windows] section, add both lines:
    [windows]
    sandbox = "unelevated"
    
  3. Fully restart Codex.

What to know first:

  • Mixed results. At least six users said this worked. It didn't work for everyone:
    • It can't be used with deny-read rules (OpenAI's docs say so).
    • It failed for users with split writable folders, on one ARM64 machine, and for at least two other users.
  • Weaker protection. OpenAI's docs call unelevated a legacy fallback, with weaker network isolation and no support for denied read paths.
  • Managed accounts. Work or school accounts may not be allowed to use this mode.
  • Undo it after updating. Once you've updated, set the line back to what it was, or delete it.

(Some users pinned the standalone CLI to 0.160.1, from before the bug. That's no longer needed: 0.163.0 has the fix.)

What users say did not help: restarting or rebooting, Windows "Repair" or "Reset", reinstalling, changing folder permissions with icacls, and ending node_repl.exe (Codex starts it again).

macOS or Linux: "Broken pipe (os error 32)"

This is a different problem. Most reports look like this:

failed to send websocket request: IO error: Broken pipe (os error 32)

They're usually followed by "Reconnecting…" and a fallback, during long or image-heavy chats. One user measured a message-size limit of about 16 MiB, but OpenAI hasn't explained it, and we found no fix when we checked on November 6, 2026.

Other cases users report:

  • A hook that exits without reading its input (#32667, #27550).
  • An MCP server that closes during start-up (#41390, and a comment on #17024).

Kingy hasn't reproduced these. We'll add a fix here once one is confirmed.

Sources

OpenAI:

Microsoft:

GitHub user reports, read 2026-11-05 and 2026-11-06:

  • #51601, #51634 and #51590: affected versions, the app fix at 26.1007.21434, the stopgap, what didn't help, and testing with a real command.
  • #53679 and #54165: a 0.162.1 CLI still failing next to an updated app. The #54165 reporter says the app's bundled CLI failed too.
  • #54635: CODEX_CLI_PATH in two files.
  • #52712: ARM64.
  • #55230: the MXC HRESULT variant.
  • #44099 and #55317: Broken pipe on macOS and the message-size measurement.
  • #32667 and #27550: hook Broken pipe.
  • #41390 and a comment on #17024: MCP start-up Broken pipe.
  • #54447: one user's diagnosis of a separate browser-use bug.