openai / openai/codex

Windows sandbox helper fails with helper_unknown_error: setup refresh had errors on every exec_command and file read

Open
#44,696 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI sandbox tool-calls windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Environment
codex-cli version: 0.153.0-alpha.5
OS: Windows 11
Sandbox mode: default (workspace-write)
Install path: %LOCALAPPDATA%\OpenAI\Codex\bin<hash>\codex.exe
Summary
On this Windows machine, every invocation of exec_command — and even plain file reads — fails at the sandbox initialization layer before reaching the tool logic. This makes codex-cli fully unusable in any workflow that needs command execution or file access, even read-only.

Steps to reproduce
Run codex.exe exec "" < /dev/null
Observe the error below on the very first tool call, regardless of what the tool call actually does.
Actual error
ERROR codex_core::tools::router: error=exec_command failed: CreateProcess { message:
"Rejected("Failed to create unified exec process: helper_unknown_error: setup refresh had errors")" }
...
ERROR codex_core::tools::router: error=unable to locate image at <file>: fs sandbox helper
failed with status exit code: 1: windows sandbox failed: helper_unknown_error: setup refresh had errors
Expected behavior
Sandbox helper initializes successfully (or fails with an actionable error naming the missing Windows dependency/feature), and exec_command/file reads work normally under workspace-write sandbox mode.

Notes / what we've ruled out
Not a CLI flag/config issue — this is a lower-level Windows sandbox helper initialization failure, distinct from the (already-fixed) "no active project" confirmation error we hit previously with a different Codex-based agent on the same machine.
We have not tried --dangerously-bypass-approvals-and-sandbox (or equivalent) to isolate whether the sandbox layer itself is the sole blocker, since this instance is driven by an unattended automation pipeline and running without sandbox isn't a safe test to run unattended.
Suspected cause (unconfirmed): a Windows optional feature or permission the sandbox helper depends on (e.g. Windows Sandbox feature, Hyper-V, or app container capability) may not be enabled on this machine. Haven't yet confirmed which one.
Related issues
GitHub's duplicate detector flagged #28278, #28457 and #34928 — all in the same Windows sandbox helper subsystem, but none appear to be the same failure:

#28278 / #28457: the launcher fails to locate the helper executable (error=program not found, or ShellExecuteExW failed... 1223), traced to a PATH/junction mismatch between the visible codex.exe entry point and the real standalone release directory.
#34928: helper crashes with 0xc0000142 (DLL init failure) specifically during the Desktop app's UAC-elevated first-run setup flow.
This issue: the helper is found and launched, but the setup refresh step itself returns helper_unknown_error: setup refresh had errors — a different failure signature, and downstream of where the other three fail. Our install also resolves directly to a versioned bin<hash>\codex.exe path rather than the junction layout described in #28278/#28457, so that specific root cause likely doesn't apply here.
Flagging the overlap in case a maintainer sees a connection we don't, but filing separately since the error text and failure point differ.

Impact
Full loss of function for any automated/headless codex-cli workflow on this machine — it can echo/respond but cannot execute or read files, since 100% of tool calls fail at this layer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Windows sandbox helper setup-refresh path reached by exec_command and file reads, then reproduce with the reported codex.exe exec invocation under workspace-write mode. Trace why setup refresh returns helper_unknown_error and identify the missing dependency, permission, or feature. Done means the helper initializes successfully, or reports an actionable Windows-specific error, and command execution and file reads work.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.