Skip to content

[Windows Desktop] workspace-write exec hangs during write-ACE setup for large workspace; empty/small workspaces succeed #48593

Open

Description

@Siyuan-chat

What version of the Codex App are you using?

Codex App: 26.915.20218
Bundled CLI: codex-cli 0.158.0-alpha.2.1
Model used during reproduction: gpt-6-astra, low reasoning effort

Platform: Windows x64
Workspace filesystem: local E: drive
Approval policy: on-request
sandbox_mode: workspace-write

Primary Windows sandbox configuration:
[windows]
sandbox = "elevated"

The issue was also tested with windows.sandbox = "unelevated".

What issue are you seeing?

In one existing, relatively large/mixed workspace, every normal sandboxed
exec_command hangs before the requested command is actually spawned.

A trivial command such as:

cmd.exe /d /c echo QUANTS_PROBE

does not return stdout, stderr, or an exit status.

The tool eventually reports only:

Script running with cell ID 1
Wall time 11–31 seconds
Output:

The same Codex installation, model, machine, and sandbox configuration work
normally when the workspace is changed to either:

  1. a new empty directory, or
  2. a small subdirectory of the failing workspace.

This appears to be workspace-dependent rather than a general shell, model,
Codex installation, or Windows sandbox failure.

Controlled A/B results

Failing workspace:

E:\codex\quants

Result:

Script running with cell ID 1
no stdout
no stderr
no exit status

Empty workspace:

E:\codex\codex-sandbox-probe

Result:

{
  "wall_time_seconds": 0.3697785,
  "exit_code": 0,
  "output": "EMPTY_WORKSPACE_EXEC_OK\r\n"
}

Small real subworkspace:

E:\codex\quants\src

Result:

{
  "wall_time_seconds": 0.4015909,
  "exit_code": 0,
  "output": "SMALL_WORKSPACE_OK\r\n"
}

So, on the same machine:

large workspace     -> hangs
empty workspace     -> ~0.37 s success
small subworkspace  -> ~0.40 s success

Direct Windows sandbox test

The bundled Codex CLI can execute the same type of command directly through
both Windows sandbox implementations.

Elevated:

codex -c 'windows.sandbox="elevated"' sandbox C:\Windows\System32\cmd.exe /d /c echo CODEX_DIRECT_ELEVATED_OK

Result:

CODEX_DIRECT_ELEVATED_OK

Unelevated:

codex -c 'windows.sandbox="unelevated"' sandbox C:\Windows\System32\cmd.exe /d /c echo CODEX_DIRECT_UNELEVATED_OK

Result:

CODEX_DIRECT_UNELEVATED_OK

This suggests the underlying Windows restricted-token sandbox and cmd.exe are
functional.

Sandbox log evidence

For the failing workspace, the sandbox log stops here:

START: ...\pwsh.exe ...
setup refresh: spawning ...\codex-windows-sandbox-setup.exe
read-acl-only mode: applying read ACLs
read ACL run completed
granting write ACE to <WORKSPACE> for sandbox group and capability SID

There is no subsequent:

setup refresh: processed ...
setup binary completed

and the requested command is never launched.

For the empty workspace, the corresponding sequence completes normally:

granting write ACE to <EMPTY_WORKSPACE> for sandbox group and capability SID
setup refresh: processed 3 write roots (read roots delegated); errors=[]
setup binary completed
helper copy: ...
helper launch resolution: ...

and the command returns successfully in ~0.37 seconds.

Process snapshot during the hang

While the large-workspace exec call is stuck:

  • codex-code-mode-host.exe is running.
  • codex-windows-sandbox-setup.exe is running.
  • No codex-command-runner.exe for the requested operation appears.
  • No cmd.exe /d /c echo QUANTS_PROBE process appears.

Therefore the requested command appears not to have been spawned yet. The
stall occurs during sandbox setup / write-root ACL processing.

Troubleshooting already performed

  • Completely restarted Codex Desktop.
  • Tested in a fresh conversation.
  • Settings -> Workspace Dependencies -> Reset and Install Workspace.
    No change.
  • Tested elevated Windows sandbox.
    Large workspace still hangs.
  • Tested unelevated Windows sandbox.
    Large workspace still hangs.
  • Direct codex sandbox succeeds in both elevated and unelevated modes.
  • Renamed the workspace .agents directory as an isolation test.
    No change.
  • Tested a completely empty workspace.
    Success.
  • Tested a small real subdirectory (<WORKSPACE>\src) as the workspace.
    Success.

The affected workspace contains many code, data, cache, output, archive, and
research subdirectories. A full recursive enumeration itself takes a long
time, so the exact file count was not collected during this diagnostic
session.

Expected behavior

A trivial sandboxed shell command should start within bounded time regardless
of unrelated files elsewhere in the workspace.

In particular:

  • write-root ACL setup should not indefinitely block process creation;
  • previously established workspace ACLs should ideally converge/cache instead
    of requiring expensive workspace-wide work on every command;
  • setup cost should not scale catastrophically with unrelated workspace
    contents;
  • if sandbox setup exceeds a reasonable timeout, Codex should surface a clear
    error instead of leaving the agent turn in Script running state;
  • Stop/cancellation should remain responsive while sandbox setup is pending.

Related issues

Possibly related to:

This reproduction may add a useful isolation point:

the same installation fails only when the large workspace root is used, while
an empty workspace and a small real subworkspace both execute successfully in
~0.4 seconds, and direct codex sandbox succeeds.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    tool-calls
    on Sep 27, 2026
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

    appbugperformancesandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions