Skip to content

Windows elevated sandbox setup helper shows “The parameter is incorrect” even with clean CODEX_HOME and short ASCII npm path; unelevated works #24490

Open

Description

@Koitar-Ananke

What version of the Codex App are you using (From “About Codex” dialog)?

26.519.41501

What subscription do you have?

Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

On native Windows 11, Codex Windows sandbox works in unelevated mode but fails in elevated mode before the requested command runs.

The elevated failure opens a Windows dialog from:

codex-windows-sandbox-setup.exe

The visible dialog message is:

参数错误。

English equivalent: “The parameter is incorrect.”

The console then reports:

windows sandbox failed: orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223

This happens even with:

  • a clean short CODEX_HOME
  • a clean short working directory
  • a short ASCII npm global prefix (C:\npm-global)
  • UAC working normally
  • ValidateAdminCodeSignatures=0
  • windows.sandbox_private_desktop=false

unelevated mode succeeds from the same environment.

Versions

OS: Windows 11 x64
Codex CLI: 0.133.0
Codex App: 26.519.5221.0
Node/npm install method: npm global install

Related issues

This appears related to:

  • Windows sandbox setup helper launch fails with ShellExecuteExW failed to launch setup helper: 1223
  • Windows elevated sandbox fails while unelevated succeeds on Codex CLI 0.133.0

Reproduction steps

1. Verify short ASCII npm global prefix

npm uninstall -g @openai/codex

New-Item -ItemType Directory -Force C:\npm-global | Out-Null
npm config set prefix C:\npm-global

$oldUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($oldUserPath -notlike "*C:\npm-global*") {
  [Environment]::SetEnvironmentVariable("Path", "$oldUserPath;C:\npm-global", "User")
}

$env:Path = "$env:Path;C:\npm-global"

npm install -g @openai/codex@latest
C:\npm-global\codex.cmd --version

Observed:

codex-cli 0.133.0

2. Unelevated sandbox succeeds

C:\npm-global\codex.cmd -c windows.sandbox="unelevated" sandbox windows cmd /c echo SHORT_PATH_UNELEVATED_OK

Observed:

SHORT_PATH_UNELEVATED_OK

3. Elevated sandbox fails

C:\npm-global\codex.cmd -c windows.sandbox="elevated" sandbox windows cmd /c echo SHORT_PATH_ELEVATED_OK

Observed visible Windows dialog:

codex-windows-sandbox-setup.exe
参数错误。

Observed console error:

windows sandbox failed: orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223

4. Clean CODEX_HOME also reproduces elevated failure

$oldHome = $env:CODEX_HOME
$env:CODEX_HOME = "C:\CodexHomeDiag"

New-Item -ItemType Directory -Force "C:\CodexHomeDiag" | Out-Null
New-Item -ItemType Directory -Force "C:\CodexDiag" | Out-Null
Set-Location "C:\CodexDiag"

@'
model = "gpt-5.5"
sandbox_mode = "workspace-write"
approval_policy = "on-request"

[windows]
sandbox = "unelevated"
'@ | Set-Content -Encoding UTF8 "C:\CodexHomeDiag\config.toml"

codex -c windows.sandbox="unelevated" sandbox windows cmd /c echo FORCED_UNELEVATED_OK
codex -c windows.sandbox="elevated" sandbox windows cmd /c echo FORCED_ELEVATED_OK

if ($oldHome) {
  $env:CODEX_HOME = $oldHome
} else {
  Remove-Item Env:CODEX_HOME -ErrorAction SilentlyContinue
}

Observed:

FORCED_UNELEVATED_OK

Then elevated fails with the same visible dialog:

codex-windows-sandbox-setup.exe
参数错误。

and the same console error:

orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223

5. sandbox_private_desktop=false also fails

codex -c windows.sandbox="elevated" -c windows.sandbox_private_desktop=false sandbox windows cmd /c echo ELEVATED_NO_PRIVATE_DESKTOP_OK

Observed:

codex-windows-sandbox-setup.exe
参数错误。

and:

windows sandbox failed: orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223

UAC / Windows policy checks

Start-Process -Verb RunAs works and successfully opens an elevated PowerShell:

Start-Process powershell.exe -Verb RunAs -ArgumentList '-NoProfile -Command "Write-Host UAC_OK; pause"'

Registry checks:

reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ValidateAdminCodeSignatures

Observed:

EnableLUA = 0x1
ValidateAdminCodeSignatures = 0x0

ValidateAdminCodeSignatures=0 rules out the UAC policy that requires interactive elevation executables to pass PKI signature validation.

What steps can reproduce the bug?

  1. On Windows 11 x64, install Codex CLI 0.133.0 with npm.

  2. Move the npm global prefix to a short ASCII-only path to rule out long path or non-ASCII username issues:

npm uninstall -g @openai/codex

New-Item -ItemType Directory -Force C:\npm-global | Out-Null
npm config set prefix C:\npm-global

$oldUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($oldUserPath -notlike "*C:\npm-global*") {
  [Environment]::SetEnvironmentVariable("Path", "$oldUserPath;C:\npm-global", "User")
}

$env:Path = "$env:Path;C:\npm-global"

npm install -g @openai/codex@latest
C:\npm-global\codex.cmd --version

Observed version:

codex-cli 0.133.0
  1. Run the same trivial command in unelevated Windows sandbox mode:
C:\npm-global\codex.cmd -c windows.sandbox="unelevated" sandbox windows cmd /c echo SHORT_PATH_UNELEVATED_OK

Observed result:

SHORT_PATH_UNELEVATED_OK
  1. Run the same trivial command in elevated Windows sandbox mode:
C:\npm-global\codex.cmd -c windows.sandbox="elevated" sandbox windows cmd /c echo SHORT_PATH_ELEVATED_OK

Observed result:

A Windows dialog appears from:

C:\npm-global\node_modules\@openai\codex\...\codex-windows-sandbox-setup.exe

The dialog message is:

参数错误。

English equivalent: “The parameter is incorrect.”

The console then reports:

windows sandbox failed: orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223
  1. Also tested with a clean short CODEX_HOME and clean working directory:
$oldHome = $env:CODEX_HOME
$env:CODEX_HOME = "C:\CodexHomeDiag"

New-Item -ItemType Directory -Force "C:\CodexHomeDiag" | Out-Null
New-Item -ItemType Directory -Force "C:\CodexDiag" | Out-Null
Set-Location "C:\CodexDiag"

@'
model = "gpt-5.5"
sandbox_mode = "workspace-write"
approval_policy = "on-request"

[windows]
sandbox = "unelevated"
'@ | Set-Content -Encoding UTF8 "C:\CodexHomeDiag\config.toml"

codex -c windows.sandbox="unelevated" sandbox windows cmd /c echo FORCED_UNELEVATED_OK
codex -c windows.sandbox="elevated" sandbox windows cmd /c echo FORCED_ELEVATED_OK

if ($oldHome) {
  $env:CODEX_HOME = $oldHome
} else {
  Remove-Item Env:CODEX_HOME -ErrorAction SilentlyContinue
}

Observed result:

FORCED_UNELEVATED_OK

Then elevated mode fails with the same visible dialog:

codex-windows-sandbox-setup.exe
参数错误。

and the same console error:

orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223
  1. Also tested with private desktop disabled:
codex -c windows.sandbox="elevated" -c windows.sandbox_private_desktop=false sandbox windows cmd /c echo ELEVATED_NO_PRIVATE_DESKTOP_OK

Observed result:

The same codex-windows-sandbox-setup.exe dialog appears:

参数错误。

and the console reports:

windows sandbox failed: orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223
  1. UAC itself appears to work. This command successfully opens an elevated PowerShell:
Start-Process powershell.exe -Verb RunAs -ArgumentList '-NoProfile -Command "Write-Host UAC_OK; pause"'

Registry checks:

reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ValidateAdminCodeSignatures

Observed:

EnableLUA = 0x1
ValidateAdminCodeSignatures = 0x0

What is the expected behavior?

The elevated Windows sandbox should either:

  1. successfully launch codex-windows-sandbox-setup.exe and run the command, printing:
SHORT_PATH_ELEVATED_OK

or

  1. return a clear actionable error explaining which Windows policy, argument, path, or setup precondition is invalid.

Actual behavior

Elevated mode fails before executing even a trivial command. The setup helper dialog says:

参数错误。

Then Codex reports:

ShellExecuteExW failed to launch setup helper: 1223

Workaround

Use:

[windows]
sandbox = "unelevated"

unelevated mode works. I am not using danger-full-access.

Additional information

No response

Activity

  1. added
    app
    on May 25, 2026
  2. added
    bug
    CLI
    windows-os
    sandbox
    on May 25, 2026
  3. github-actions commented on May 25, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. wenan4 commented on Jun 19, 2026

    @wenan4

    I can reproduce what looks like the same issue on Codex Desktop for Windows 26.616.3767.0.

    Environment:

    • Windows 11, version 25H2
    • Codex Desktop for Windows 26.616.3767.0

    With the following config:

    [windows]
    sandbox = "elevated"

    Desktop tool-host FS sandbox calls fail with:

    orchestrator_helper_launch_canceled: ShellExecuteExW failed to launch setup helper: 1223
    

    After this happens, tools such as view_image, apply_patch, and node_repl stop working.

    Switching the config to:

    [windows]
    sandbox = "unelevated"

    and fully restarting Codex Desktop restores the tools.

    This does not look like a missing binary or proxy/local setup problem on my machine, because:

    • codex-windows-sandbox-setup.exe exists.
    • The hashes match.
    • CLI sandbox setup logs can complete successfully.
    • The failure seems specific to the Codex Desktop/MSIX elevated helper launch context.

    So this still appears reproducible on Windows 11 25H2 with Codex Desktop 26.616.3767.0.

  5. sng06989-oss commented on Jul 10, 2026

    @sng06989-oss

    Independent reproduction on Codex Desktop for Windows (Korean locale).

    Environment

    • Codex Desktop/MSIX: 26.707.3748.0 x64
    • Install path: C:\Program Files\WindowsApps\OpenAI.Codex_<version>_x64__<publisher>\
    • Windows: Microsoft Windows NT 10.0.26200.0
    • UI/system locale: Korean
    • EnableLUA = 1
    • ConsentPromptBehaviorAdmin = 5
    • seclogon: Running
    • mpssvc (Windows Defender Firewall): Running / Automatic

    Symptoms

    After uninstalling and reinstalling the Codex Desktop app, Windows sandbox onboarding still fails. The elevated helper displays the localized equivalent of:

    The parameter is incorrect.
    

    The helper path shown in the dialog is the packaged:

    ...\OpenAI.Codex_26.707.3748.0_x64__...\app\...\codex-windows-sandbox-setup.exe
    

    Codex then shows that Windows installation/setup did not complete. A sandboxed local diagnostic also reproduced:

    windows sandbox: orchestrator_helper_launch_canceled:
    ShellExecuteExW failed to launch setup helper: 1223
    

    This persists after:

    1. Full app uninstall/reinstall.
    2. Reboot.
    3. Launching Codex with Run as administrator and approving UAC.
    4. Verifying UAC is enabled.
    5. Verifying Secondary Logon and Windows Defender Firewall services are running.
    6. Testing with a clean generated Codex workspace under the user's Documents folder.

    No CodexSandbox* local users were created, although a Codex firewall rule was present, suggesting setup stopped partway through.

    Workaround and secondary limitation

    Setting:

    [windows]
    sandbox = "unelevated"

    allows ordinary read-only shell_command calls to work. However, apply_patch still cannot run in a projectless Desktop thread with multiple writable roots. The exact diagnostic is:

    failed to prepare fs sandbox: failed to prepare windows sandbox wrapper:
    windows unelevated restricted-token sandbox cannot enforce split writable root sets directly;
    refusing to run unsandboxed
    

    Granting Modify ACLs to the workspace (including Everyone for diagnosis) does not change the apply_patch result, confirming that this second failure is the unelevated wrapper's split-root restriction rather than an NTFS ACL denial.

    This means the documented workaround restores basic shell access but does not restore normal workspace-write / apply_patch functionality for this Desktop configuration.

  6. sng06989-oss commented on Jul 10, 2026

    @sng06989-oss

    Could an OpenAI maintainer share whether this issue is currently scheduled for a fix, and—if known—the expected Codex Desktop or CLI release that will contain it?

    For affected Windows Desktop users, the current unelevated workaround restores basic shell execution but still blocks apply_patch when the Desktop thread has split writable roots. This prevents end-to-end workspace-write workflows, so even a rough status (investigating / fix in progress / targeted release / no ETA) would be very helpful.

    Thank you.

  7. doublemover commented on Sep 1, 2026

    @doublemover

    Crazy how it's been months and this is unresolved.

    If you're still suffering, run this from elevated Powershell:

    $codex = Get-ChildItem "$env:LOCALAPPDATA\OpenAI\Codex\bin" `
         -Recurse -Filter codex.exe -File |
         Sort-Object LastWriteTime -Descending |
         Select-Object -First 1 -ExpandProperty FullName
    
    & $codex sandbox setup --elevated --current-user

    It should respond with
    Windows elevated sandbox setup completed for doublemover at C:\Users\doublemover\.codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIappbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions