Skip to content

[Windows] CLI 0.157.1 elevated sandbox provisioning fails with helper_unknown_error and creates no sandbox.log #48517

Closed

Description

@smrtlb

What version of Codex CLI is running?

0.157.1

What subscription do you have?

ChatGPT Plus

Which model were you using?

No response

What platform is your computer?

Windows 11 Professional Version/build: 10.0.26200 x64

What terminal emulator and version are you using (if applicable)?

Microsoft.WindowsTerminal 1.24.11911.0
PSVersion
Major 5 Minor 1 Build 26100 Revision 9549

Codex doctor report

What issue are you seeing?

The elevated Windows sandbox should provision successfully and allow basic local commands such as:

cmd /c echo OK

to start normally.

If provisioning fails, Codex should expose the underlying Windows/Win32 error and create the documented sandbox diagnostic log instead of returning only:

helper_unknown_error: setup refresh had errors

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Sep 26, 2026
  2. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. smrtlb commented on Sep 26, 2026

    @smrtlb
    Author

    Potential duplicate #48479 was reviewed.

    I do not believe this is the same issue.

    #48479 is primarily about model-dependent retry/recovery behavior after a Windows sandbox setup refresh failure.

    This report is about the underlying elevated sandbox provisioning failure itself in Codex CLI 0.157.1, specifically:

    • provisioning consistently fails before child process creation;
    • CODEX_HOME.sandbox\sandbox.log is not created at all;
    • RUST_LOG=trace still exposes only helper_unknown_error;
    • no underlying Win32 error is surfaced;
    • the failure persists independently of model retry behavior.

    Feedback/thread ID:
    01a0df23-9d9b-7940-ac78-dd715aef9938

  4. smrtlb commented on Sep 28, 2026

    @smrtlb
    Author

    Update after upgrading to OpenAI Codex v0.158.0:

    The issue is still reproducible.

    I fully closed the previous Codex session/application, upgraded to v0.158.0, reopened Codex in the affected working project, and ran:

    cmd /c echo OK

    Result:
    Failed to create unified exec process:
    helper_unknown_error: setup refresh had errors

    The command does not start.

    So the elevated Windows sandbox provisioning failure persists in v0.158.0 as well.

    This is not specific to CLI 0.157.1 anymore.

  5. smrtlb commented on Sep 30, 2026

    @smrtlb
    Author

    Resolved locally.

    After about a week of troubleshooting this issue with ChatGPT without finding a working fix, I tried the same problem with Claude. Claude suggested a recovery sequence that restored the Windows elevated sandbox.

    What worked for me:

    1. Terminated all running Codex processes:

    Get-Process codex* -ErrorAction SilentlyContinue | Stop-Process -Force
    Get-Process codex -ErrorAction SilentlyContinue | Stop-Process -Force

    1. Removed the npm CLI and local Codex state:

    npm uninstall -g @openai/codex
    Remove-Item -Path "$env:USERPROFILE.codex" -Recurse -Force

    1. Reinstalled the current CLI:

    npm install -g @openai/codex@latest

    1. Launched the Codex Windows Desktop/Chat application before running the CLI again.

    2. The Desktop app then initialized/reprovisioned the elevated Windows sandbox environment.

    3. After that, codex doctor reported the sandbox as healthy.

    4. CLI command execution started working again, including Git operations from the project directory.

    The key observation is that reinstalling the npm CLI and running codex doctor immediately had not fixed the issue before. The recovery only succeeded after the Desktop app was launched and allowed to initialize/recreate the sandbox state.

    Current working version: Codex CLI v0.159.2.

    I cannot confirm whether launching the Desktop app first is an intentional requirement or simply the recovery path for a corrupted/incomplete sandbox state, so I would treat the steps above as a workaround/recovery procedure rather than a universal installation requirement.

    Also note that deleting %USERPROFILE%\.codex is destructive to local Codex state/config/history, so this should be done only with that consequence understood.

    Thanks to Claude for identifying the recovery path after the previous troubleshooting attempts had not resolved it.

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

    CLIIssues related to the Codex CLIbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions