Repository navigation
Description
codex sandbox leaks one Windows logon session per invocation
Reporter: Pedro Bento
Platform: Windows 11 Pro 26200
Versions affected: codex-cli 0.144.3 and 0.146.0 (both measured)
Summary
On Windows, every codex sandbox invocation creates an interactive logon
session for the CodexSandboxOffline sandbox account and never releases it.
The sessions accumulate inside lsass.exe for the lifetime of the boot. Because
lsass cannot be restarted, the only way to reclaim them is a reboot.
After 23 hours of automated use this machine held 15 510 orphaned logon
sessions and lsass had grown to 79 396 handles. The symptom is
progressive, whole-desktop slowness — dragging, minimising and maximising
windows become visibly laggy — that persists after every Codex process has
exited and disappears only on reboot.
codex exec does not leak. Only codex sandbox does.
Evidence
Security event 4624 for the leaked sessions:
LogonType 2 (Interactive)
LogonProcessName seclogo (Secondary Logon service, in svchost)
AuthenticationPackageName Negotiate
TargetUserName CodexSandboxOffline
The sessions are orphaned — enumerating Win32_LogonSession and associating to
Win32_Process returns no process for any of them. No process on the machine
holds a comparable handle count, so nothing but lsass is retaining them:
lsass 79 396 handles
System 22 068
explorer 8 253
codex 3 296
Not a profile-hive leak: HKEY_USERS holds 6 keys and no C:\Users\CodexSandbox*
profile directories exist.
Reproduction
function N { (Get-CimInstance Win32_LogonSession).Count }
$before = N
1..20 | ForEach-Object {
codex sandbox -P :workspace -c windows.sandbox="elevated" -- cmd /c exit 0
}
"leaked: $((N) - $before)"Measured with paired idle blocks before and after to subtract background:
| version | mode | leaked per invocation |
|---|---|---|
| 0.144.3 | elevated |
0.9 – 1.5 |
| 0.146.0 | elevated |
0.66 |
| 0.144.3 / 0.146.0 | unelevated |
0 |
A short 6-invocation run can read as zero — the measurement needs enough
invocations, and idle control blocks on both sides, to clear the noise.
codex exec --sandbox workspace-write -c windows.sandbox="elevated" running a
shell command leaks nothing, which is what makes the asymmetry look like a
missing handle close on the codex sandbox path specifically rather than in
sandbox setup generally.
Why unelevated is not a workaround
unelevated does not leak, but on both versions it:
- leaves the network reachable even with
--sandbox-state-disable-network
(a TCP connect to1.1.1.1:443succeeds inside the sandbox), and - kills child processes created with piped stdio —
node -e "require('child_process').execSync('node -v', {stdio:'pipe'})"
fails withspawnSync ... EPERM, which breaksnode --testand similar
runners.
elevated blocks the network correctly (EACCES) and allows piped spawns, so
it is the only usable mode — and it is the one that leaks.
Impact
Any automated use that invokes codex sandbox per command accumulates this
quickly. At roughly 668 sessions/hour on this workload the machine reaches
five figures within a day, and the degradation is indistinguishable from a
general "Windows is slow" problem, which makes it very hard to attribute. It
took a full day of elimination — GPU, VRAM, DWM, MPO, GDI handles, disk,
memory pressure — before the logon-session count was measured.
Expected
codex sandbox should release the logon session it creates when the sandboxed
command exits, or reuse a single session across invocations.
Activity
Darkplates commentedon Jul 29, 2026
Cross-referencing: this is very likely the same underlying defect as #33356
(handle growth per sandboxed command), and probably related to #34062 (profile
load per command) and #34575 (lost logon session / error 1312). Maintainers may
want to consolidate.
What this report adds beyond #33356 is the mechanism and the accounting: the
growth is one logon session per
codex sandboxinvocation, created throughthe Secondary Logon service (event 4624,
LogonProcessName seclogo, targetCodexSandboxOffline) and never released, which is why the handle count inlsasstracks it at roughly 5 handles per session and why only a reboot clearsit. It also isolates the asymmetry —
codex execrunning shell commands doesnot leak, only
codex sandboxdoes — which should narrow where the missingrelease is.
Darkplates commentedon Jul 29, 2026
Follow-up with a finding that should help reproduction: the leak is
state-dependent, not constant.
After a reboot cleared the 15 510 accumulated sessions, the same
measurements that reliably leaked before now leak nothing:
codex sandbox -P :workspace -c windows.sandbox="elevated"on thefresh boot: 0 sessions leaked (pre-reboot: the same batch leaked 5-12).
10 sandbox invocations): 0 sessions leaked,
lsasssteady around1 500-3 000 handles. Pre-reboot the same workload leaked 668-1080/hour.
So a fresh
lsassreleases theCodexSandboxOfflinelogon sessionscorrectly, and something later tips it into never releasing them; once that
happens, every launch strands one session and only a reboot recovers. The
trigger is what I cannot isolate from outside -- uptime, a session-count
threshold, or some failed cleanup that flips the behaviour. The 22-hour
uptime figures in the original report describe the degraded regime.
Practical implication for anyone measuring: a short test on a fresh machine
will conclude "no leak" and be wrong an hour or a day later. Watching
(Get-CimInstance Win32_LogonSession).Countover time is the reliablesignal.
MajesticMug commentedon Aug 26, 2026
Bump
This is causing severe performance issues during long sessions and the only way to release those orphaned resources is through a PC restart.
This should be a higher priority!
Darkplates commentedon Aug 26, 2026
I will be honest about this: I am now running Codex on 2 different computers and both have the same issue - I'm LOVING codex with 5.6 sol Ultra.. but the ammount of subagents it calls for and the tasks they run... my new computer (5080 with ryzen 7 7800x3d, 32gb DDR5 6000) still needs to be restarted every 4-5 hours if I want to run Codex on ultra. I'm unclear how prevalent this bug is in codex CLI, but using Codex windows app I can guarantee it's unbearable.
I understand this might not be affecting all users, but I'm choosing to mantain an OpenAI first envoirement - Codex windows app is vital for this. And this should be something OpenAI should strive for, allowing a user to remain in their ecosystem. Right now I paid 3k€ for a new computer and I still need stop everything and restart every 6 hours if I want to avoid going down to 0.3-0.6 fps. It makes close to 0 sense, specially the lack of replies, considering this is an issue that has been raised in multiple tickets, from multiple people.
MajesticMug commentedon Aug 26, 2026
Yup! I wouldn't be too harsh on the Codex team, they have a gigantic backlog of 5k GitHub issues and combing through all that doesn't look like an easy task!
I suspect that they are working on a major Codex rework or V2 - which would be a lot easier than tackling 5k issues!
ArsenBilov commentedon Sep 10, 2026
Independent real-world observation consistent with the reported LSASS/logon-session leak
I recorded a 37.6-hour Windows Codex Desktop + VS Code extension session and observed the same persistent whole-desktop degradation and LSASS handle accumulation described here.
Environment:
26.901.6511.026.901.22334to26.903.61454during the sessioncodex-cli 0.153.4windows.sandbox = "elevated", although the capture did not preserve the configuration file and therefore cannot prove the setting was unchanged throughout the runObserved LSASS handle count:
LSASS gained 39,132 handles. Its thread count and private memory remained nearly flat.
The increase was much faster during active agent work, approximately +1,500 to +1,800 handles/hour, and slowed to approximately +100 to +180 handles/hour during quieter or overnight periods.
Codex/ChatGPT and Explorer restarted during the session, but LSASS retained the accumulated handles and the system-wide lag persisted. Only a Windows reboot returned LSASS to the normal low-thousands range and restored responsiveness.
CPU, available RAM, disk latency, DPC/interrupt activity, and GPU utilization were all non-saturated during the worst marked lag period.
I was not manually invoking the standalone
codex sandboxcommand. The workload consisted of normal Codex Desktop and IDE agent activity with many command/tool executions. Therefore, this result does not prove whether the leaked resources came from the exactcodex sandboxpath described here, from the sandboxedcodex execpath discussed in #33356, or from a shared internal implementation used by Desktop/IDE clients.I could not inspect Security Event 4624 for
CodexSandboxOfflinebecause Security log access was denied, and no WPR Handle trace was captured during the strongest lag. The exact leaked object type therefore remains unconfirmed.Could the maintainers clarify which internal sandbox entry point Desktop and IDE agent commands use, and whether it shares logon-session/token lifetime management with either
codex sandboxor sandboxedcodex exec?A privacy-reviewed timeline and aggregate handle/counter extracts are available. The complete evidence set contains 40 files and passed SHA-256 manifest verification.
xPkFyre commentedon Sep 14, 2026
Adding a kernel-level root cause for this, since the thread so far stops at the symptom (orphaned LogonType 2 sessions accumulating in lsass). We traced it into the kernel and it is an OS token-reference leak that the sandbox's token model triggers on every command.
Environment: Windows 11 Pro 25H2, build 26200.9445. Codex Desktop 26.903.9818.0, sandbox runner 0.153.4,
[windows] sandbox = "elevated".Root cause
Each sandboxed command creates a fresh interactive logon (via
CreateProcessWithLogonW/ seclogon) forCodexSandboxOffline/CodexSandboxOnline, then builds a restricted token with restricting SIDs (CreateRestrictedToken, i.e. theNtFilterTokensyscall). Inside that syscall the kernel duplicates a token and takes one reference on it that is never released. The orphaned token is then cached in the logon session'sTokenfield, and because a live token pins its own logon session, the session'sReferenceCountcan never fall to zero and it is never torn down.Evidence (live kernel dump)
Pinned
_SEP_LOGON_SESSION_REFERENCESforCodexSandboxOffline:That cached token is orphaned but alive (
HandleCount: 0 PointerCount: 1), and object-reference tracing on it shows one reference and zero dereferences:Every frame is
nt!. There is no Codex frame in the leaking path. Walking the logon session chain, this is systematic: 20-plus consecutiveCodexSandbox*sessions, each with an emptyTokenListbut a distinct orphaned cached token (HandleCount 0,PointerCount 1,TokenFlags 0x2020) holding it alive. One leaked session plus token per command. In this dump: 24,673 sessions and roughly 125,000 lsass handles after 2.7 days of use, with lsass burning about 1 to 1.4 cores just walking the oversized session table (NTLM credential updates plussfapm.dllopening tokens by logon id).It is an OS bug the sandbox pattern triggers
We reproduced it with a minimal native executable: an interactive logon,
CreateRestrictedTokenwith restricting SIDs,CreateProcessAsUserto launch a child, then close every handle we own. No Codex runner, IPC, job object, or private desktop. The session still leaks. Narrowing the controls: a bare interactive logon cleans up, a token-only filter (no process launch) cleans up, and a restricted token launched as a process is the case that leaks. So the trigger is the specific combination of a restricting-SID filtered token used to launch a process on an interactive logon.Caveat for reproducers:
!obtraceonly records operations by threads in the traced image, so a dereference on a system worker thread would not appear. The load-bearing evidence is not the trace count, it is the objective dump state: the token still exists with a handle count of zero and one pointer reference, and it pins a session that is one of thousands accumulated.Suggested fix
The kernel over-reference is not patchable from Codex, and is worth reporting to Microsoft against
SepFilterTokenon this build. On the Codex side, the leak can be avoided entirely by not creating a fresh interactive logon plus a restricted token per command. Options: reuse one long-lived sandbox logon session across commands, run a persistent sandbox worker process, or confine with a job object / AppContainer that does not route through the token-filter path. Any of those converts thousands of leaked sessions into one.railapex commentedon Oct 1, 2026
I can reproduce the leak on demand, and I have a candidate trigger. It happens only while Windows' foreground lock is armed, meaning within
ForegroundLockTimeout(default 200 s) of keyboard or mouse input. That would explain the "state-dependent" behavior reported above: the leak shows up while someone is using the machine and stops when they step away.Setup: same machine, same boot, same script each time.
codex exec --sandbox read-onlyis told to make 10 shell calls, each runningcmd /c "cmd /c echo …". I counted logon sessions before each batch and 20 s after it:I paired Security events 4624 and 4634 by
TargetLogonId, and the pairs agree. In the 10:00 batch, 6 of the 10CodexSandboxOfflinelogons have no logoff and are still live. From 07:30 to 10:00, while nobody was at the machine, there were 147CodexSandboxOfflinelogons. That count includes the two idle batches plus other Codex activity. Every one of them logged off within a few seconds.Earlier that morning, 77 of 83 logons had no logoff. The same command (
git rev-parse HEAD) leaked on some launches and not others, so the command's content is not the trigger.This matches the Windows bug that bentoner traced in #30926 (write-up: https://github.com/bentoner/windows-token-leak). When a process creates a process,
win32kfull!CForegroundLaunch::_CheckAllowForegroundtakes a reference on a primary token and never releases it, and it only reaches that code while the foreground lock is armed. My inference, not traced: that leaked reference lands on the sandbox's restricted token, and a live token keeps its logon session alive. That fits the orphaned token in the kernel dump above (HandleCount 0, PointerCount 1). That dump's!obtraceonly records references taken by threads in the traced image, so a win32k reference taken on another process's thread would not show up there.On this box, turning the lock off confirms bentoner's token leak. With me at the keyboard, 500 processes that each start a process left 343 tokens behind at the default timeout, and 24 with
ForegroundLockTimeoutset to 0. An idle control left 22. Details are in #30926.Turning the lock off mostly stops the sandbox leak too. I ran with
ForegroundLockTimeoutat 0 for an evening of normal use, including stretches at the keyboard. In that time there were 275CodexSandboxOfflinelogons and every one logged off, by the same 4624/4634 pairing. The one exception is a controlled batch of 10 run the moment I sat back down at the machine. It left 2 sessions behind with the lock off, against 6 of 10 with it on.The latest cumulative update does not fix it. After Windows Update moved the machine to build 26200.9550 (
win32kfull.sys10.0.26100.9549), with the lock back on, a Codex session this morning left 3 of 4 logons with no logoff.A reboot on 09-28 reset the live timeout to 2147483647, and I didn't reapply the workaround. Three days later lsass held 883 logon sessions, against 22 just after boot. I haven't paired these by event yet. On the previous boot, 1,058 of the roughly 1,100 live sessions were
CodexSandboxOffline.What this means:
ForegroundLockTimeoutto 0 (per user, viaSystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT)) stops the token leak and nearly all of this one. The cost is that any app can then take focus. The call is refused while the lock is armed. Run it from Win+R, which works because Explorer is the foreground process, and repeat it after every logon. Check the live value, not the registry. Windows 11 sets the live value to 2147483647 at every logon regardless of the registry (OpenText documented this, and this machine does it after every reboot). At that value, any input keeps the lock armed for 24.9 days, which is why the leak looks constant during normal use.Environment: Windows 11 Pro 25H2, builds 26200.9278 and 26200.9550; codex-cli 0.157.0 (standalone) and 0.157.1 (npm); Codex Desktop 26.924.2738.0;
[windows] sandbox = "elevated". After 16 days of uptime the machine had 1,058 liveCodexSandboxOfflinesessions, and lsass held 8,655 Semaphore and 1,321 Token handles.cc @zm-oai @iceweasel-oai, the most frequent recent committers under
codex-rs/windows-sandbox-rsherdr: run Codex workers in WSL; avoid the elevated sandbox leak
Tuguk commentedon Oct 5, 2026
Here's a data point from a newer build, plus two things this thread doesn't cover yet.
Still present on Codex Desktop 26.930.3930.0, Windows 11 25H2 26200.9457, with
[windows] sandbox = "elevated". The app has since updated to 26.930.4958.0 / codex-cli 0.160.0; I haven't re-measured on that version. A singleecho testfrom the Desktop agent tookLsaEnumerateLogonSessionsfrom 16,646 to 16,647, and it was still 16,647 78 s later. By then lsass held ~104,700 handles (86,659 Semaphore, 16,780 Token) and was using ~160% of one core continuously.Fast Startup keeps the leak across shutdowns. Fast Startup is on by default in Windows. With it on, Shut down followed by power-on is a hybrid boot (Kernel-Boot event 27, boot type
0x1). lsass is hibernated and resumed along with every orphaned session. This machine was shut down every day, so its owner believed it had been rebooted. The last full boot (0x0) was actually 19 days earlier, which is how it reached 16.6k sessions. Only Restart clears the sessions, or Shut down once Fast Startup is turned off. Workaround advice that says "reboot" should say Restart.Symptom: 3–4 s hangs on paste. The first visible symptom here wasn't window lag. It was intermittent 3–4 s freezes on Ctrl+V in Chrome, Firefox (Google Sheets, Excel Online) and Notepad when copying between apps; Notepad→Notepad was fine. During a freeze the window still answered
WM_NULL, and no process held the clipboard open. A Restart fixed it immediately: 10 sessions, 2,156 lsass handles, 0% CPU. I inferred the link from lsass to paste; I didn't trace it. I'm posting it so people searching for "paste lag" can find this issue.talraveh1 commentedon Oct 8, 2026
Data point on the newest CLI and a newer Windows branch:
codex execstill leaks on codex-cli 0.160.0 (npm) and Windows 11 Pro 26H2, build 26300.9457. Every build reported above is 26200.x. It is the same pattern @railapex measured on 0.157: most sandboxed commands leave aCodexSandboxOfflinelogon session behind.Run: one
codex execwith[windows] sandbox = "elevated"and the defaultread-onlysandbox, told to make 10 separate shell calls that runwhoami. Each ran asCodexSandboxOffline. 2026-10-08, 14:40:31 to 14:41:19 local time, with the machine in interactive use.Security events 4624 paired with 4634/4647 by
TargetLogonId(script below):CodexSandboxOfflinelogons (type 2,seclogo)Win32_LogonSessionwent from 133 to 140 across the run and was still 140 two minutes later.Kernel tokens: the live count of pool tag
Tokerose by about 140 during the run and was back to its pre-run level (16,469) seven minutes after the run ended. So a stranded session pins very few token objects, consistent with the single cached token per session in @xPkFyre's dump. The cost is the session and lsass growth, not token pool.Foreground lock: the live
ForegroundLockTimeouthere is 2147483647 whileHKCU\Control Panel\Desktopholds 200000, so the logon-time override described above also happens on 26H2, and the lock was armed for the whole run. I did not change it, so this is not an A/B test of that trigger.Codex Desktop 26.1002.6548.0 is also installed (its
codex-windows-sandbox-service.exeruns as SYSTEM). The run above used the CLI only.Pairing script (elevated PowerShell; needs Logon and Logoff success auditing)
With no arguments it covers everything since boot;
-From '2026-10-08 14:40:31' -To '2026-10-08 14:41:19'gives one window.xlookum commentedon Oct 15, 2026
Still reproducing on the newest build I can find:
[windows] sandbox = "elevated"After 9.2 days of uptime:
CodexSandboxOfflinelogon sessions (Win32_LoggedOnUser)CodexSandboxOfflinetype-2 logons (4624,seclogo) todayToken)No Codex process holds a meaningful share of the token handles (largest is ~700 handles total), so closing the app does not release anything — consistent with the kernel/lsass-side analysis above.
Possibly new:
csrss.exefor session 1 is at 11.1 GB private bytes (working set ~10 MB, so it's almost entirely paged-out commit). That's ~418 KB per leaked session. csrss is flat while I watch it (no growth over 5 sandbox logons in 3 minutes), so it seems to grow in steps rather than per command — I'm treating this as correlation, not proof, but nobody in this thread has mentioned csrss yet and it's 11 GB of commit charge on a 64 GB machine. Has anyone else checkedcsrss(session 1) private bytes on an affected machine?Practical impact here: total commit hit ~110 GB on 63 GB RAM, which pushed everything else into the pagefile and caused system-wide stutter.
BIOcanse commentedon Oct 27, 2026
Another data point from a heavily automated Windows setup.
Environment
codex execdirectly with-c sandbox_mode="workspace-write". Several runs are usually in parallel, and each run executes many sandboxed commands.0.164.0-alpha.11.1Observation (about 47 h after boot)
CodexSandboxOfflineinteractive logon sessions (Win32_LogonSessiongrouped by account)That is +511 in 28 minutes, about 1,100 per hour under this load. Sessions are never released before reboot.
Other figures:
lsass.exe: 28,597 handles at the second sample, including about 20,100 semaphore handles, roughly 4 per leaked session.Toke: 198 MiB.This matches #35940 and #33356. Both the Desktop app and the
codex execruns use the same sandbox account on this machine, so I cannot say how many sessions each one contributes. The growth rate does track the automatedcodex execworkload.I can provide a timeline of session count against command count if that helps.
lorthris commentedon Oct 31, 2026
Still present on the newest builds, plus a measurement of what each leaked session costs in kernel memory. As far as I can see, nobody in this thread has posted that cost yet.
Environment
HiberbootEnabled = 0), so the counts below cover a real 11 days of uptime.26.1023.6621.0, app-servercodex-cli 0.164.0-alpha.11.1, standalonecodex-cli 0.165.0[windows] sandbox = "elevated". Normal interactive use of the Desktop app, plus headlesscodex execcalls.Session count (2026-10-31, booted 2026-10-20)
CodexSandboxOfflinelogon sessions (Win32_LoggedOnUser)Kernel pool cost (
NtQuerySystemInformation(SystemPoolTagInformation))TokeSeAtSeTdSeDtThat is about 4.5 GB of paged pool, and total paged pool is 8.9 GB. Commit charge is 29.2 of 31.9 GB, so on a 24 GB machine this is now pushing toward commit exhaustion, not just slowing things down.
What I think this adds:
Tokeallocations ÷ 13.5 k sessions), and only about 55 k Token handles exist system-wide. So most of the leaked tokens are held by kernel references, not handles. That fits @xPkFyre'sNtFilterTokentoken-reference analysis, and it suggests every derived or filtered token pins the session, not only the logon token.TokeandSeTdhave identical allocation counts, andSeDtis close to them. That is consistent with whole token objects leaking, rather than just their dynamic parts.This is the top resource drain on the machine, and the only remedy is a reboot every few days. Could a maintainer acknowledge it and say whether a fix is planned? Even an interim mitigation would help, such as reusing one logon session per runner instead of a fresh
CreateProcessWithLogonWper command, or explicitly closing the derived restricted tokens. I can run a debug build or collect more counters (for example ETW or!logonsessionoutput) if that would help.HK1211 commentedon Nov 13, 2026
Reproduced on codex-cli 0.167.0 after a clean restart — logon session persisted for at least 15 minutes
Environment. Windows 11 Pro 25H2 (26200.9711). The runs below used codex-cli 0.167.0 (npm) with
[windows] sandbox = "elevated". Codex Desktop 26.1103.4239.0 and its sandbox service were also running. Third-party security software with kernel-mode components is installed (AhnLab V3 Lite / Safe Transaction). We did not test without it.Clean-restart pair (one run each, no model call)
codex sandbox -- cmd /c exit 0codex sandbox -- powershell -NoProfile -Command "git --version"LsaEnumerateLogonSessions)TargetLogonId)CodexSandboxOffline, type 2,seclogo. Its LogonId equals the new LUID. No 4634 when queried at about +9 minSo a fresh boot was not enough to prevent the leak here. Earlier in this thread, 8 runs on a fresh boot leaked none.
The
cmd /c exit 0run was released this time, although the original report saw that command leak. That fits the intermittent per-launch behaviour @railapex reported, where the same command leaked on some launches and not others. With one run each, we did not measure a leak rate, and we cannot say what differed between R1 and R1b.We read
ForegroundLockTimeoutonly from the registry (200000). We did not read the live value, so these runs cannot be placed relative to the foreground-lock trigger.Before that restart (6 d 8 h uptime, about 4 days of heavy automated multi-agent use)
.sandbox/sandbox.YYYY-MM-DD.log) has 14,453START:lines since boot: PowerShell 7,894,--codex-run-as-fs-helper6,544, other 15.LsaEnumerateLogonSessionsreturned 12,523 logon sessions. The interactive user could read details for only 2 of them.START:lines: Pearson r = 0.77, Spearman ρ = 0.70.Tokeallocations were about 2.47 M (5.1 GB). We do not attribute that figure to the stranded sessions: it kept rising by about 80/min while no sandbox commands ran. This is in line with @talraveh1's note that stranded sessions pin few token objects.Not established by this data: the trigger condition, the leak rate, what pins the session, and the cause of the user-visible slowdown on this machine. Other kernel-resource anomalies were present at the same time.
Question. The thread has suggested reusing one sandbox logon per runner or per session, rather than one per command. Is that viable for elevated mode? We can provide additional diagnostic data, or run a targeted reproduction, if maintainers identify a specific measurement that would help.
NicolasDLT commentedon Nov 14, 2026
Another data point, with a measurement this thread doesn't have yet: what the leak does to process-creation latency for everything else on the machine.
Environment. Windows 11 Pro 25H2 (26200). Codex Desktop 26.1111.2228.0, bundled
codex-cli 0.167.0-alpha.3.2. Heavy automated use: up to 8 parallelcodex exectasks inworkspace-write, each running tests and git, plus read-only review runs.lsass handles.
Sampling every 30 s after the restart and grouping by 10-minute windows, growth tracked the number of concurrent
codex execwrite tasks almost exactly: +1 with one read-only review, +43/+79 with no Codex task, +254/+487 with one write task, +1,070/+1,353 with 3–5 write tasks. A batch of 71 Python/git tests (no Codex) spawning thousands of processes moved lsass from 1,846 to 1,808 (no growth). A single read-only review over 7 minutes: ~1,900 → ~1,970.Effect on everything else (the part that made it hard to attribute). Our CI-like validation spawns ~45,000 short processes (git, python, cargo). It records the median and p90 time of 20
git --version/python -c passspawns at start:The test count barely changed between those runs (+27% Python tests, same Rust tests, +15% spawned processes), and the Rust test phase (identical test count) went from 6 to 47 minutes. So the leak slows down every
CreateProcesson the machine, not just desktop responsiveness: any build or test runner that spawns many processes degrades over the day and recovers only after a restart. As noted above, a shutdown with Fast Startup is not enough.mcmorry commentedon Nov 16, 2026
Data point that adds the kernel stack behind the process-creation slowdown NicolasDLT measured above.
Environment. Windows 11 Pro 25H2 (26200), Codex Desktop 26.1106.6628.0, codex-cli 0.167.0,
[windows] sandbox = "elevated", Fast Startup on.Where the launch time goes. An elevated WPR trace of a probe that times 300
CreateProcesscalls, alternatingcmd /d /c exitandgit --version, on a machine with about 6 days of uptime. All 8 launches over 198 ms were held insident!SepCleanupMarkedForDeletionEntries, the kernel's security-token index maintenance, during process creation. Three charged about 230–250 ms of CPU to the calling thread in that cleanup, and five waited about 200–233 ms on the same kernel lock. Image file opens took microseconds, and Defender and other file-system filters were not in the slow stacks. This is consistent with the stranded sessions and tokens slowing every process launch on the machine, not only lsass, though the trace alone does not prove the link.Growth with uptime. The same 300-launch probe every 6 hours after a Restart. The slowest launch grew steadily: 5 ms at boot + 16 min, then 23, 26, 27, 41, 45, 50, 54, 56, 54, 67, 73 and 92 ms at boot + 3 days. Six hours later it was 248 ms, with 29 of the 300 launches over 100 ms. At 78 h of uptime
LsaEnumerateLogonSessionsreturned 414 sessions, and only 2 of them were interactive. Fivecodex sandbox -- cmd /c exitruns raised the count by 5, and it stayed there.