Skip to content

Windows 0.144.1: elevated sandbox adds ~20s per command; unelevated restores speed but breaks apply_patch with split roots #32314

Description

@solankydev

What version of Codex is running?

Codex CLI 0.144.1. The behavior reproduces through both Codex Desktop and Codex CLI because both use the same native Windows sandbox configuration.

Platform

Windows 11 Professional, x64, build 26200.

What issue are you seeing?

On native Windows, the elevated sandbox adds a large delay before every sandboxed shell command starts. The command, filesystem, Git, and PowerShell operations themselves are fast.

Changing only the Windows sandbox implementation from elevated to unelevated removes the command delay, but then apply_patch cannot update workspace files because the managed session includes split writable roots.

This leaves no sandbox mode in which both normal command execution and the preferred patch-editing path work reliably.

Sanitized timing evidence

A trivial local file-read command was measured in the same workspace and session configuration:

Configuration Total tool wall time Script/file operation
Elevated sandbox, normal tool call 22.9–35 seconds 3 ms–1.06 seconds
Unelevated sandbox, after restart 0.6 seconds 5 ms
Outside-sandbox control 0.8 seconds 73–129 ms

A direct sandbox startup comparison showed:

Sandbox implementation Startup time
Elevated 3.3–6.3 seconds
Unelevated 0.45–0.56 seconds

Repeated elevated runs remained slow after warm-up.

codex doctor reported the installation, configuration, authentication, databases, and connectivity as healthy. The slowdown occurred before the requested process performed meaningful work.

Steps to reproduce

  1. On Windows, configure:
[windows]
sandbox = "elevated"
  1. Restart Codex.
  2. Run multiple trivial sandboxed commands, such as:
Write-Output "ok"
  1. Compare wall time with the command's internal execution time.
  2. Change only the sandbox implementation:
[windows]
sandbox = "unelevated"
  1. Restart Codex and repeat the command. It completes immediately.
  2. In a managed workspace-write session, try to update an existing file using apply_patch.
  3. Observe:
windows unelevated restricted-token sandbox cannot enforce split writable root sets directly; refusing to run unsandboxed

The writable-root set includes the workspace plus runtime-managed temporary roots; no custom writable roots are required to reproduce the patch failure.

Expected behavior

At least one supported Windows sandbox configuration should allow both:

  • ordinary sandboxed shell commands to start without multi-second or multi-tens-of-seconds orchestration delays; and
  • apply_patch to create, update, and delete files inside the active workspace.

If elevated sandbox setup or ACL refresh is unhealthy, codex doctor should detect it and provide an actionable repair command.

Actual workaround

Using:

[windows]
sandbox = "unelevated"

restores normal shell-command performance, but it is a weaker sandbox and leaves apply_patch unusable with the managed split-root profile.

No dangerous/full-access mode was used.

Related issues

This report adds a complete measured reproduction on 0.144.1 across both Desktop and CLI, plus the interaction between the performance workaround and the split-root patch failure.

Activity

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 CLIappIssues related to the Codex desktop appbugSomething isn't workingperformancesandboxIssues related to permissions or sandboxingtool-callsIssues related to tool callingwindows-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