Repository navigation
Description
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:
- a new empty directory, or
- 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.exeis running.codex-windows-sandbox-setup.exeis running.- No
codex-command-runner.exefor the requested operation appears. - No
cmd.exe /d /c echo QUANTS_PROBEprocess 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 sandboxsucceeds in both elevated and unelevated modes. - Renamed the workspace
.agentsdirectory 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 inScript runningstate; - Stop/cancellation should remain responsive while sandbox setup is pending.
Related issues
Possibly related to:
- “Approve for Me” mode makes apply_patch 3,128× slower on a large repository (Windows) #35018 — large Windows workspace causes workspace-write ACL/setup cost to
scale dramatically with file count - Windows: corrupted workspace dependency bundle halts all shell execution; Diagnose reports "healthy" and app reinstall does not fix #35803 — sandbox setup can deadlock after
granting write ACEand never log
setup binary completed - [Critical][Windows] Recurring local execution failure: PowerShell/CMD never return, Node kernel times out; coding tasks blocked #44623 — Windows local exec can yield
Script running with cell ID 1
without stdout/stderr/exit status
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