You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows elevated sandbox repeatedly scans pnpm node_modules, causing 100% disk usage and 30–130s tool latency #33737
On Windows, local Codex tasks using the elevated sandbox repeatedly start codex-windows-sandbox-setup.exe and recursively process a large pnpm workspace.
This saturates disk active time and causes apply_patch, rg searches, and
other tool calls to wait 30–130 seconds, even though the underlying command
usually completes in milliseconds or a few seconds.
Environment
Codex App version: 26.715.2305.0
OS: Windows
Shell: PowerShell
Sandbox: elevated / Ask for approval
Workspace: pnpm project with 1617 directories under node_modules/.pnpm
Git submodules: 3
Multiple local Codex tasks may access the same workspace concurrently
Symptoms
Disk active time reaches 100%
Approximately 4 MB/s reads and 70 MB/s writes
Multiple codex-windows-sandbox-setup.exe processes run concurrently
The processes have different codex.exe parent processes
Setup processes exit and are launched again shortly afterwards
Process Monitor shows many operations under node_modules/.pnpm and
submodules with results including:
INVALID PARAMETER
NO MORE FILES
apply_patch may already have written the file, but its completion response
does not return for 30–130 seconds
Measurements
With elevated sandbox/tool setup active:
Tool response latency: 30–130 seconds
Small file read inside the actual command: approximately 114 ms
rg operation inside the actual command: approximately 178 ms
Control test using danger-full-access:
Enumerating 1617 top-level .pnpm directories: 40 ms
git submodule status: approximately 2 seconds
This suggests the workspace filesystem itself is healthy and the delay is
caused by repeated Windows sandbox initialization/ACL processing.
Expected behavior
Sandbox initialization should be cached or avoid recursively reprocessing
large dependency trees for every task/tool invocation.
Concurrent tasks using the same workspace should not launch competing full
workspace scans.
Actual behavior
Each task appears to launch or relaunch codex-windows-sandbox-setup.exe, causing metadata-heavy writes and disk
contention across all tasks.
Aggregate Codex disk write rate was about 24.2 MB/s; individual setup helpers showed roughly 3.5–4.6 MB/s.
The sandbox log showed three setup helpers spawned within milliseconds when the task issued three tool calls in parallel.
Each helper independently granted the same write ACEs to the same roots (visualization output, %TEMP%, workspace parent, and current workspace), then ran read-acl-only mode: applying read ACLs.
All completed with errors=[]; this was not an error/retry loop.
The three identical scans each took about 17 seconds.
The dominant root was %TEMP%, which contained:
36,686 files
25,525 directories
1.94 GiB
One stale node-compile-cache alone contained 29,896 files.
After deleting verified stale Temp caches/test profiles:
Temp fell to 4,968 files, 21,172 directories, 0.95 GiB.
The same sandbox setup pass fell from about 17 seconds to 3.3 seconds.
A subsequent 10-second idle sample showed 0 KB/s writes from the Codex process group, with zero setup helpers remaining.
Additional findings:
Five stale node_repl.exe browser-helper children had accumulated under the active codex.exe across several hours. Disabling Browser/Chrome/Computer Use and the Node REPL MCP, then stopping those stale helpers, left zero.
Local Codex diagnostic/session storage was also large: logs_2.sqlite about 1.36 GiB and rollouts about 5.22 GiB.
The VM's 250 GiB system disk had only about 25 GiB free, and the machine had previously become unstable/crashed during these bursts.
Serialize/debounce identical Windows sandbox setup refreshes within a Codex process.
Cache ACL state and avoid recursively reprocessing unchanged roots for every tool call.
Coalesce parallel tool launches so they share one completed setup refresh.
Avoid recursively scanning %TEMP% unless it is actually required as a writable root, and ensure the Temp exclusion settings are honored by Desktop sessions.
Terminate Browser/Node helper processes when the owning task/tool session ends.
Add rotation/size limits for diagnostic databases and rollout retention.
No private project names, account identifiers, or credentials are included here.
Local reproduction: repeat setup refreshes and large temp/workspace scan
Windows desktop 0.150.0-alpha.12.2:
Workspace E:\My-codex: about 85,486 files / 4.9 GB
%TEMP% before: about 12,709 files / 2.25 GB
%TEMP% after moving stale browser/automation caches: about 1,114 files /
899 MB (11,596 files / 1.35 GB moved to recoverable backup)
Sandbox log contains repeated setup refresh: spawning codex-windows-sandbox-setup.exe with 2–5 launches in the same second
Disabling 8 optional MCP servers/plugins and enforcing agents.max_concurrent_threads_per_session = 1 made codex doctor report sandbox provisioning: complete
This matches the earlier measurement in this issue: the same setup refresh is
expensive when %TEMP% or a large workspace contains many small files, and
parallel calls each launch their own helper.
Suggested upstream improvements remain:
Cache/serialize identical sandbox setup refreshes per Codex process.
Activity
github-actions commentedon Jul 17, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
genusJoe commentedon Jul 21, 2026
Confirming this on a newer Windows build with additional measurements.
Environment:
26.715.7063.0(Microsoft Store)0.144.6workspace-write+[windows] sandbox = "elevated"Observed with one active local task:
codex-windows-sandbox-setup.exeprocesses.%TEMP%, workspace parent, and current workspace), then ranread-acl-only mode: applying read ACLs.errors=[]; this was not an error/retry loop.The dominant root was
%TEMP%, which contained:node-compile-cachealone contained 29,896 files.After deleting verified stale Temp caches/test profiles:
Additional findings:
node_repl.exebrowser-helper children had accumulated under the activecodex.exeacross several hours. Disabling Browser/Chrome/Computer Use and the Node REPL MCP, then stopping those stale helpers, left zero.logs_2.sqliteabout 1.36 GiB and rollouts about 5.22 GiB.Current reversible mitigation:
Requested fixes:
%TEMP%unless it is actually required as a writable root, and ensure the Temp exclusion settings are honored by Desktop sessions.No private project names, account identifiers, or credentials are included here.
lvchongjun123-bot commentedon Sep 6, 2026
Local reproduction: repeat setup refreshes and large temp/workspace scan
Windows desktop
0.150.0-alpha.12.2:E:\My-codex: about 85,486 files / 4.9 GB%TEMP%before: about 12,709 files / 2.25 GB%TEMP%after moving stale browser/automation caches: about 1,114 files /899 MB (11,596 files / 1.35 GB moved to recoverable backup)
setup refresh: spawning codex-windows-sandbox-setup.exewith 2–5 launches in the same secondagents.max_concurrent_threads_per_session = 1madecodex doctorreportsandbox provisioning: completeThis matches the earlier measurement in this issue: the same setup refresh is
expensive when
%TEMP%or a large workspace contains many small files, andparallel calls each launch their own helper.
Suggested upstream improvements remain:
%TEMP%/large-tree read-ACL scans.