macOS Codex relaunch loop exhausts syspolicyd file descriptors and blocks app launches
Open 💬 56 comments Opened May 30, 2026 by guidedways
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.527.31326 (3390)
What subscription do you have?
Pro
What platform is your computer?
macOS
What issue are you seeing?
syspolicyd is seeing one /Applications/Codex.app/Contents/MacOS/Codex process opening every 1 second, and the entire system freezes up after a little while, nothing opens with Too many files opened errors. I've tried killing every codex process, killing syspolicyd, rebooting etc, it starts to spam syspolicyd the moment I launch Codex.app
/
/usr/libexec/syspolicyd
/usr/lib/dyld
/Library/Preferences/Logging/.plist-cache.1EfNczv9
/private/var/db/SystemPolicyConfiguration/Tickets-shm
/private/var/db/analyticsd/events.allowlist
/private/var/db/timezone/tz/2026b.1.0/icutz/icutz44l.dat
/private/var/db/SystemPolicyConfiguration/KextPolicy-shm
/usr/share/icu/icudt78l.dat
/private/var/db/SystemPolicyConfiguration/ExecPolicy-shm
/System/Library/Frameworks/Security.framework/Versions/A/PlugIns/csparser.bundle/Contents/MacOS/csparser
/private/var/db/mds/messages/se_SecurityMessages
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/Resources/Localizable.loctable
/System/Library/Frameworks/CFNetwork.framework/Versions/A/Resources/DafsaData.bin
/dev/null
/dev/null
/dev/null
/private/var/db/SystemPolicyConfiguration/Tickets
/private/var/db/SystemPolicyConfiguration/Tickets-wal
/private/var/db/SystemPolicyConfiguration/Tickets-shm
[ctl com.apple.netsrc id 7 unit 63]
/private/var/db/SystemPolicyConfiguration/KextPolicy
/private/var/db/SystemPolicyConfiguration/KextPolicy-wal
/private/var/db/SystemPolicyConfiguration/KextPolicy-shm
/private/var/db/SystemPolicyConfiguration/gke.bundle/Contents/Resources/gk.db
/private/var/db/SystemPolicyConfiguration/ExecPolicy
/private/var/db/SystemPolicyConfiguration/ExecPolicy-wal
/private/var/db/SystemPolicyConfiguration/ExecPolicy-shm
192.168.1.28:53283->17.248.213.70:https
/private/var/db/SystemPolicyConfiguration/XProtect.bundle/Contents/Resources/gk.db
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
... **several hundreds more**
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Applications/Codex.app/Contents/MacOS/Codex
/Users/fahad/.codex/computer-use/Codex Computer Use.app/Contents/MacOS/SkyComputerUseService
/Applications/Codex.app/Contents/MacOS/Codex
What steps can reproduce the bug?
Launch Codex
What is the expected behavior?
_No response_
Additional information
_No response_
56 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
If I turn off
Locked useunder settings, this stops happening. Actually it's theComputer Useplugin - if I turn this off, it stops.It seems Computer Use gets re-added the moment you launch Codex. My entire mac is unusable, no other app or script works when I launch Codex. I've downgraded to
Version 26.519.81530 (3178)and this works perfectly.Update:
Version 26.519.81530 (3178)(previous update) fixes this, as well as the excessive CPU usage issues for me. I don't see any new entry show up insyspolicydI continue to see this in
Version 26.602.30954 • Released Jun 4, 2026- no difference,26.519.81530is the only working version.@etraut-openai This one's making it impossible to use Codex. Every single person I know (on codex) is affected. Numerous other reports, too. Please can we have this urgently looked into?
I've encountered this issue as well
@guidedways, it looks like a fix for this was attempted in
26.602.30954, but it sounds like it may not have completely fixed the problem (see this analysis). I'll raise the issue with the team.Thank you so much!
I should add - I wouldn't even call this a partial fix, this was a temporary fix for the original version (from last week) that started behaving this way. That version behaved the same way -
syspolicydtemporarily throttled or held back after a force-quit, before it went into a frenzy again. The only thing that truly helped was turning off Computer Use but recently it seems Computer Use gets forcefully added back even if it's turned off.If you're still seeing this issue with
26.602.30954+, please use/feedbackto upload logs and post the session ID here.I am still, I downgraded the moment I saw the
syspolicydstorm. I was worried that background tasks and scripts might start to fail. I’ll take a look at it soon and report back, thanks 😅@etraut-openai
no-active-thread-019e97e4-070b-7aa2-99ce-95bf97655b29and019e97e3-59a8-7332-ad12-4630aa8cad0fSteps:
syspolicydandtrustd26.602.30954 build 3575syspolicydand my M3 Max spikes to 50%+ CPU usagesyspolicydback to normalVersion 26.602.40724 • Released Jun 5, 2026no difference, 136% CPU usage, syspolicyd hangs, so does Codex repeatedly and everything slows down.Feedback:
no-active-thread-019ea3b7-861a-73c1-a278-aad9aeca102bComputer Use seems to be the reason - I've turned it off, yet it gets re-installed repeatedly and causes a hang.
The main concern is that if Computer Use is turned off in settings, it should not install the
computer-usefolder in~/.codex- it adds it regardless and this installed app is what's causing all the problems. I expect this to be installed only if and when I enable it in settings.@etraut-openai I'm having the same issue. I'm in the EU so I don't have access to computer use, the bug appears right after starting.
Session id: no-active-thread-019ea63a-b71e-7210-9e70-3d903a1891be
Reverting to 26.519.81530 fixes the issue but automatic worktree creation is broken there :(
Severe system hang, 170%+ constant CPU usage
no-active-thread-019eb6ce-d5ff-7ab1-9a83-59dc3ef99a96@etraut-openai it's been more than 2 weeks, numerous updates in between and every single one behaves the same way. Even if you turn off computer use,
syspolicydhangs the entire system the moment I launch Codex. Is there no solution to this?I've tried clearing up nearly everything under
~/.codexand trying the latest version again, no luck. Simply installing it (and before I can even launch it), the fans go off and the computer hangs.Stuck on version
26.519.81530from 2 weeks ago.Consolidating #25882 here. This is the canonical report for the macOS Codex relaunch loop causing syspolicyd/trustd pressure and app-launch failures, including reports with and without Computer Use enabled.
I'm also affected by this issue. An older build like 26.527.31326 (3390) works correctly.
I've been having these constant performance issues with Codex app since its initial release and it still didn't resolve.
This bug is a critical blocker to me (and many others I'd assume). The syspolicyd saturation slows the entire system, codex is slow, all my work is slowed, and the laptop is unusable on battery because it drains so fast. This is on a very powerful machine, m4 max 64gb ram. I hope this is being given top priority for a fix asap.
Cross-linking #28100, which I'm closing as a duplicate of this canonical issue. Adding two data points I didn't see explicitly covered in this thread, plus confirmation of the Computer-Use re-creation behavior.
Environment
26.609.41114Two findings that may help narrow the cause:
syspolicydreached ~450% CPU withtrustdspiking alongside it after Codex was already open and sitting idle — no prompt, no active turn, no task. It calms down and then returns on its own later without me launching anything new.approval_policy = "never", andsandbox_mode = "danger-full-access". None of them changed the behavior.Sample evidence captured during a spike.
syspolicyd(pid 506) —Dispatch Thread Soft Limit: 64 reached in 1699 of 4894 samples; hot stacks are code-signing / notarization / YARA / signature verification:trustd(pid 427) — certificate/signature verification on the same window:This is consistent with the fd-exhaustion / no-backoff relaunch mechanism written up in #25882:
syspolicydis repeatedly assessing code bundles/frameworks and askingtrustdto verify cert chains.Confirming the Computer-Use re-creation behavior others here have reported (@flitzrrr, @davidsupan, @DavidSchargel, @energissimo-mg):
syspolicydstill spiked.notify = [...]line pointing atSkyComputerUseClient→ on restart Codex recreated it. (Per @davidsupan, settingnotify = []explicitly survives restart where commenting out does not — will try that next.)~/.codex/computer-useaside and recreated it empty → Codex recreated the bundle on restart. I eventually had to lock it with permissions/flags so it couldn't reinstall.This corroborates the consensus that disabling Computer Use does not stop the loop — the relaunch mechanism is the root cause and the Computer-Use hook re-creation is an aggravator, not the sole trigger.
Collateral damage worth flagging: during the storm, unrelated apps failed to launch — Arc failed with a system-policy / code-signing error on its Sparkle framework, and launched fine only when Codex was closed, then broke again after Codex was reopened. One diagnostic attempt destabilized the machine into a crash/reboot.
Full original report with the raw samples is in #28100.
Follow-up to my earlier comment, with
fs_usageevidence that pinpoints the assessment target. This looks like a no-denial variant of the loop — distinct from the fd-exhaustion/relaunch pattern in #25882.Setup:
notify = []was already set (and survives restart, per @davidsupan's note), Computer Use blocked, browser/chrome plugins disabled. The spike still happens on every launch.What's spiking
syspolicyd: with Codex open,syspolicydsits at ~170% CPU while emitting zero log lines and zero Gatekeeper denials.sudo fs_usage -f filesys syspolicydshows why — severalsyspolicydworker threads continuously re-stat64/access/getattrlistthe app's own main executable, dozens of times within a few milliseconds:Eight-plus distinct
syspolicydworker threads (931119,931560,931562,931564,931568,931570,931571,931574…) all re-validate the same binary in a tight loop → thousands of full code-signature assessments/sec, each pulling in the YARA-scan + notarization-revocation work seen in stack samples. The…/Codex/Wrapperprobe returns errno 20 (ENOTDIR) because the executable is a file, not a bundle — part ofvalidateDirectory, repeated on every pass.New trigger clue — it tracks window focus: switching focus away from Codex (even while it keeps running) settles
syspolicydback to idle; switching focus back to the Codex window immediately re-spikes it. That points at a window-activation / foreground code path repeatedly requesting a fresh Gatekeeper/SecCodeassessment of the main binary, rather than a startup-only or relaunch-driven loop.Environment: Codex Desktop
26.609.41114, macOS 15.7.5 (24G624), Apple Silicon.Consistent with other reports: downgrading to
26.519.81530avoids it; no config change on the current build stops it.Controlled A/B isolating the
notify/folder "recreation" behavior from thesyspolicydstorm.On the good build
26.519.81530, I unlocked~/.codex/computer-use(it had been emptied +chflags uchg'd, withnotify = []) and relaunched. Within ~3 seconds the app:Codex Computer Use.app(the bundled helper) +config.jsonreappeared, andnotifyfrom[]back to the volatile helper path:Note the
--previous-notify "[]"argument: the app recorded that the user had setnotify = []and overrode it anyway.Despite all of that,
syspolicydstayed at ~0% CPU (1.6% → 0.2%), with the restored helpercodesign-valid ("satisfies its Designated Requirement") and zero Gatekeeper denials.The same recreation/override behavior also occurs on the broken
26.609.41114— but only there doessyspolicydrun away (~170% sustained, re-assessing/Applications/Codex.app/Contents/MacOS/Codexon window focus, per my earlierfs_usagecomment).| | Recreates folder + rewrites
notify|syspolicydrunaway ||---|---|---|
|
26.609.41114(broken) | yes | yes ||
26.519.81530(good) | yes | no |Conclusion: the
notify/folder "recreation" behavior is build-independent and not the cause of the CPU storm. The storm is the newer build repeatedly re-assessing its own main binary, independent of Computer Use being enabled or not. Worth separating these two in triage — disabling/locking Computer Use doesn't fix the storm, and the storm reproduces regardless of Computer Use state.Separately, the
--previous-notify/override behavior is still a real UX bug (it ignores an explicitnotify = []), just not the performance one.My issue with syspolicyd and trust has been automatically resolved last Monday by installing updated Codex, after this was monitoring and no spikes of syspolicyd were observed. after it was another update and all is good. one week already
Current version Version 26.609.41114 • Released Jun 12, 2026 works OK
Adding a local root-cause narrowing data point. This may be one concrete amplification path for the macOS
syspolicydpressure, separate from whether Computer Use is the original trigger.Environment:
26.609.41114What I observed before local PATH remediation:
ps.fs_usage -w -f execshowed Codex attempting to resolvepsthrough PATH rather than calling/bin/psdirectly./bin, each probe expanded into many failedposix_spawnattempts before finally reaching/bin/ps.ps/bin/psexecutionsAppleSystemPolicyactivity attributed to/Applications/Codex.app/Contents/MacOS/Codexsyspolicydheld large numbers of FDs pointing at the Codex main executable.Local mitigation tested:
I changed only the user shell PATH, not Codex binaries and not macOS system files:
/binnear the front while keeping/opt/homebrew/binfirst to avoid changing Homebrewbashbehaviorpslookup shape became:After restarting Codex Desktop:
70-second verification window:
After re-enabling Browser Use / Computer Use and restoring the previously disabled helper executables (
extension-host,SkyComputerUseClient), I still see shortsyspolicydFD bursts against the Codex main executable, but they release instead of growing monotonically.5-minute window:
Follow-up 3-minute FD-only window:
During this later window,
extension-hostandSkyComputerUseClientwere running.Interpretation:
This does not prove the whole macOS / AppleSystemPolicy FD lifecycle, and it does not rule out Computer Use / Browser Use as additional triggers. But it does suggest that Codex's process probe is using PATH-based resolution for
ps, which can become a large multiplier on machines with long user PATHs.Upstream hardening suggestion:
/bin/psdirectly for this probe, or run it with a sanitized minimal PATHThis changed the issue on my machine from monotonic
syspolicydFD runaway to short, self-releasing bursts.Corroboration of the PATH-amplification finding — independent machine, same-build / same-daemon A/B.
Following the earlier report that a long user
PATH(many user-writable dirs before/bin) amplifies thesyspolicydre-assessment loop, I reproduced both the amplifier and a mitigation on26.609.41114(current latest), Apple Silicon, macOS 15.7.5.Before: my login
PATHhad/binat position 10, with 5 user-writable dirs searched before it (gcloud, nvm, vite-plus, homebrew/bin, homebrew/sbin). Codex inherits this via itsshell_snapshotfeature.**A/B — same build, same
syspolicyddaemon (PID 506, never restarted, 21h uptime):**| State | syspolicyd |
|---|---|
|
PATHunchanged | ~170% sustained — runaway ||
/binhoisted to position 1 (nothing else moved), relaunched | peak ~38%, releases to ~0 — bounded bursts |In both states
fs_usage -f filesys syspolicydshows ~8–10 worker threads re-assessing/Applications/Codex.app/Contents/MacOS/Codex(stat64/access/getattrlist, the…/Codex/Wrapper[20]ENOTDIR probe, and_CodeSignature/CodeRequirements-1). The fix didn't stop the re-assessment — it stopped it accumulating into a runaway.Two caveats:
/binline). But same-build + same-never-restarted-daemon makes the hoist the most likely cause, and it matches the prior independent report.Trigger worth emphasizing for whoever picks this up: the re-assessment is window-focus-driven, not startup-only or timer-based. That points at a focus/activation handler re-running a
SecCode/Gatekeeper check on the main bundle.Net: a
PATHwith/binearly can convert the runaway into bounded bursts on the current build — a usable workaround — but the real fix still needs the per-focus re-assessment cached/single-flighted upstream, and/or any process probe (ps) invoked by absolute path or with a sanitized minimal PATH.Additional data point from Codex Desktop 26.609.41114 (build 3888) on macOS 26.5.1 (25F80), Apple Silicon.
This may be a separate amplifier rather than the primary relaunch/PATH issue described above:
/var/folders/.../X/com.openai.codex.code_sign_clone.code_sign_clone.*dir, ~1.2 GB, 8,269 files, 30CodeResources, containingCodex.app.bundle.lsof +Dshows the Codex main process holding the clonedContents/MacOS/Codexpath. That file is hard-linked to/Applications/Codex.app/Contents/MacOS/Codex(same inode/link count 2); larger payloads such asapp.asarandCodex Frameworkare separate copies.SkyComputerUseServiceexit within 5s. From +5s through +60s,lsof +Dshows no holders under the clone dir, but the 1.2 GB clone remains.code_sign_clone,code-sign-clone, orMacAppCodeSignClonecleanup entries appeared in the quit-window system log.launchctl limit maxfilesreports soft 256 / hard unlimited; during the bad state the Codex main process had ~255 open entries.I do not think this proves
code_sign_cloneis the root cause. It does look like it could amplify the SystemPolicy/Gatekeeper work and the "too many open files" failure mode, especially if Chromium macOS code-sign clone cleanup is not running on normal Codex quit.This also seems distinct from the PATH
/bin/psamplifier reported above; both could be present on the same machine.Additional findings: PATH lookup appears to amplify
syspolicyd/trustdI investigated this locally because I was seeing intermittent Computer Use validation failures with
too many open filesafter restarting Codex.app.Environment:
maxfiles: soft 256, hard unlimited/Applications/Codex.apppassesspctl/ notarization checksI compared two Macs on the same macOS and Codex Desktop versions:
syspolicydspikes and priortoo many open filesfailures around Computer Use validation.code_sign_clonedirectories, but did not reproduce the severe spike or FD failure.What seems relevant
code_sign_cloneis created on every Codex.app launch under:On the affected MacBook, before cleanup I saw 9.4G / 8 clone directories / 66,152 files. After normal Codex.app quit, the clone directory remained, and
lsof +Dreported no holder. The Mac mini showed the same clone accumulation behavior, so I do not think clone retention alone is sufficient to explain the severe failure, but it is likely an amplifier.The bigger difference was PATH shape:
/binat position 44, many mise-managed user-writable directories before system directories.psexists only at/bin/pson both machines.Validation
After a clean reboot on the affected MacBook:
| Test | PATH condition |
syspolicydpeak |trustdpeak || --- | --- | ---: | ---: |
| Normal launch |
/binlate in login-shell PATH | 120.4% | 25.5% || Temporary launchd PATH |
/bin:/usr/bin:/usr/sbin:/sbin| 41.0% | 19.7% || Normal launch again | launchd PATH restored | 150.6% | 85.7% |
| Gated zsh PATH hoist | shell startup hoisted
/bin:/usr/bin:/usr/sbin:/sbin| 0.2% | 3.3% |This made PATH lookup the strongest local signal.
Exec evidence
A root
fs_usage -f execcapture during a clean-clone Codex launch showed Codex-related spawns of:/bin/ps/usr/bin/ditto/usr/bin/sw_vers/usr/bin/xcode-selectThe clearest trace was
xcode-select: Codex attempted many PATH entries before finally reaching/usr/bin/xcode-select. The failed attempts included my shim directory, many~/.local/share/mise/installs/...directories, cargo, Homebrew, mise shims,/usr/local/bin, and the Cryptex app/usr/binpath.In the same clean-clone exec run:
syspolicydpeak: 50.9% at +5strustdpeak: 34.7% at +5slsofrows peaked at 229SkyComputerUseServicewere gone,lsof +Dreported no clone holder, but the clone root remainedA separate
fs_usage -f filesysrun directly showed theCodexprocess creating thecom.openai.codex.code_sign_cloneroot and acode_sign_clone.*child directory. It also showedsyspolicydchecking/Applications/Codex.appand the copied~/.codex/computer-use/Codex Computer Use.app, anddittocopying the bundled Computer Use app out of/Applications/Codex.app.Local mitigation
I added a narrow PATH shim at the front of my login shell PATH:
The shim directory is mode
555and currently contains:For
git, I resolved the current PATH order withwhence -a gitand pointed the shim to the first real non-shimgitalready active in my normal environment. On this machine that is/opt/homebrew/bin/git, not/usr/bin/git.I used this targeted shim instead of moving
/bin:/usr/bin:/usr/sbin:/sbinahead of the whole PATH because it preserves my normal developer-tool resolution order and only changes the specific commands observed in Codex startup diagnostics.If later diagnostics find more internal bare system-tool invocations, this shim directory can be extended narrowly by adding more symlinks to the intended system binaries. With the current shim in place, clean-clone validation runs stayed below the original 120-150%
syspolicydpeaks, though there was still run-to-run variance. The shim is only a local mitigation, not a real fix.Hypothesis / upstream suggestions
My current hypothesis is:
/binand/usr/bin, macOS execution policy / Gatekeeper work is amplified by failed PATH lookups or spawn attempts.code_sign_cloneaccumulation adds a large signed-app-like temporary tree and likely increases the amount of signing/filesystem work, but is not sufficient by itself.maxfileslimit of 256 makes the failure mode worse when Codex is already around 220-230 open files.Potential upstream hardening:
/bin/ps/usr/bin/ditto/usr/bin/sw_vers/usr/bin/xcode-selectgit: inherit the user's developer PATH if needed, but avoid repeated PATH scans where possible.code_sign_clonedirectories on normal termination or next startup when no process holds them.Additional current repro from another affected macOS system, sanitized to avoid local usernames, account info, project paths, or thread contents.
Environment:
Observed behavior:
syspolicydrunaway described in this issue.syspolicydreached ~143% CPU and ~2.6 GB RSS after ~14 minutes with Codex open.codex app-server,SkyComputerUseService, and multiplecua_node/bin/node_replprocesses were present.SkyComputerUseClientunder the Computer Use install path.syspolicyd/trustddoes not recover cleanly while Codex/Computer Use is still running because the bad state appears to recur.Why this looks like the same unresolved bug:
syspolicyd/trustd, or downgrade to 26.519.81530 where users in this thread reported the issue stops.I am intentionally not pasting raw
ps,lsof, unified log, or config output here because those can contain local identifiers or thread data. The sanitized finding is: 26.609.71450 + Computer Use/SkyComputerUseClient 1.0 build 809 still reproduces thesyspolicydrunaway and system-wide app launch failure mode.Feedback session ID uploaded via
/feedback:019e873a-d51a-7c12-9a7c-ea275eb84801Reproducible on Codex Desktop 26.609.71450 (build 3965) — the
26.602.30954fix attempt does not resolve itFresh repro with macOS-generated diagnostics, on a build newer than the attempted fix.
Environment
com.openai.codex, notarized Developer ID (OpenAI OpCo, LLC — 2DC432GLL2)Symptoms
syspolicydsustained 13–23% CPU, RSS ballooned to ~3.2 GB (from ~100 MB baseline).spctl --assess /Applications/Codex.appreturnedToo many open files(EMFILE).syspolicyddid not self-recover after I killed every Codex process — it stayed pegged at ~17% CPU / 3.2 GB and kept writing itsExecPolicyWAL for ~10 min with no Codex running (livelock in syspolicyd's own state, not just live load).Evidence (
/Library/Logs/DiagnosticReports, OS-generated)syspolicyd"disk writes" microstackshot: dirtied 2147 MB to its SQLite store over 3316 s; heaviest stack is a pure WAL-commit loop:sqlite3_step → vdbeCommit → sqlite3PagerCommitPhaseOne → pagerWalFrames → unixWrite → guarded_pwrite_np; footprint grew 113 MB → 1146 MB. Attribution: "On Behalf Of: Autoupdate (originated by Codex)".codex"disk writes" report: dirtied 8589 MB over 3399 s (~2.5 MB/s sustained)./var/db/SystemPolicyConfiguration/ExecPolicygrew to 20 MB with an actively-written WAL.Contributing trigger (matches #25719)
~/.codex/config.tomlhadnotifypointed at the volatile helper path~/.codex/computer-use/Codex Computer Use.app/Contents/SharedSupport/SkyComputerUseClient.app/Contents/MacOS/SkyComputerUseClient(turn-ended).Recovery note
sudo launchctl kickstart -k system/com.apple.security.syspolicyis blocked by SIP (150: Operation not permitted while System Integrity Protection is engaged).sudo killall syspolicyd trustdworks and restores app launching (quit Codex first, otherwise it re-triggers).Happy to run
/feedbackand post a session ID if useful.Additional evidence: invalid project roots can drive the
stable-metadata/gitworker path into thesyspolicydFD issueI have an additional local root-cause data point from macOS on 2026-06-16. It seems to connect two previously reported threads:
stable-metadata/workerId=gitfailures, as described in #19201syspolicydfile descriptor pressure / Gatekeeper launch failures, as tracked in the syspolicyd issue threadWhat was different in this reproduction
The trigger was not Computer Use, TCC, SIP, Edge, WPS, or a damaged Codex signature. The trigger was a large set of stale project roots in
~/.codex/config.toml.Local audit:
Most bad entries were projectless scratch conversation directories under a
Documents/Codex/YYYY-MM-DD/...style tree. They appear to have been created by projectless / attachment-style Codex Desktop or VS Code bridge chats and later trusted as projects.Evidence
sampleon the Codex GUI process showed a Node/ElectronThread: gitworker callinguv_spawn -> posix_spawn.fs_usage -f execshowed repeatedposix_spawnattempts from Codex during the failure window.AppleSystemPolicydenials against the Codex main executable.codesignandspctlpassed for Codex itself, so this was not a damaged-signature issue.syspolicydheld many file descriptors pointing at/Applications/Codex.app/Contents/MacOS/Codex.Fix / workaround that stopped it
I backed up and cleaned
~/.codex/config.toml, removing allMISSINGandNONGITproject blocks while keeping only valid Git project roots.After restarting Codex:
Hardening that prevented recurrence
Because Codex Desktop can create new trusted project entries for projectless scratch roots, I also made the scratch root a local-only Git repository with only a
.gitignorecommitted:That makes future
Documents/Codex/YYYY-MM-DD/...scratch children resolve throughgit rev-parse --show-toplevelinstead of being classified asNONGIT.I also moved the scratch directory out of iCloud Drive and replaced the original path with a symlink to avoid cloud-sync side effects, although the main trigger was the invalid/non-Git project metadata.
Suggested product-side fix
The app should treat invalid project roots as a bounded metadata failure:
git rev-parse --show-toplevelaggressively forMISSING/NONGITproject rootsstable-metadata/gitworker repeatedlyposix_spawncommands in a way that cascades into Gatekeeper re-assessment of the Codex main binaryThis workaround fully stopped the issue locally without changing SIP, SystemPolicyConfiguration, TCC, Computer Use, or reinstalling Codex.
@daihao1975-dotcom thank you!!! This was it!
Update: spoke too soon, I'm seeing syspolicyd flooded with
Second Update: I removed ALL the projects listed under config.toml and now it's back to 0.0% CPU!!
Nope, it's back again. Now I see syspolicyd flooded with
Stuck on
Version 26.519.81530 (3178)I guess. No luck updating Codex.Follow-up after reading @guidedways' latest verification and the
code_sign_clone/.../Codex.app.bundle/Contents/MacOS/Codexrecurrence.I agree that my earlier
config.tomlcleanup should not be read as “the whole bug is only stale projects in config”. On my affected machine, cleaning~/.codex/config.tomlwas necessary but not sufficient once Codex Desktop had already rehydrated stale workspace/projectless state.The recurrence path I saw locally was:
config.tomlhad already been cleaned (codex-prune-projects --dry-runreported no invalid project roots).TERM_PROGRAM=vscode,VSCODE_*,PWD=$HOME, and a long PATH where system dirs were late.Thread: gitworker withuv_spawn -> posix_spawnin samples.syspolicydcontinued to accumulate FDs on the Codex binary until the old Codex process was fully exited and relaunched with a clean environment.The additional local cleanup that made the fix stick here was:
~/.codex/.codex-global-state.json, especially:projectless-thread-idsthread-workspace-root-hintsthread-projectless-output-directoriesactive-workspace-roots,electron-saved-workspace-roots, andproject-order~/.codex/state_5.sqlite~/.codex/sqlite/state_5.sqliteNONGIT.TERM_PROGRAM=vscodeVSCODE_*/usr/bin:/bin:/usr/sbin:/sbinPWDpoints at a real git workspace, not$HOMEAfter that, with the GitHub plugin still enabled, my final verification was:
syspolicyddid still show startup/plugin-activation FD spikes after the clean relaunch, including one restart around ~1.5k Codex FDs, but the important difference was that the FDs were released instead of growing monotonically. A later 70s sample settled to:So my current interpretation is:
config.tomlmay not be enough because Desktop can rehydrate stale projectless/workspace state from global state or sqlite session state;code_sign_clonemay be a separate remaining amplifier or visible target path, especially when the old state is only partially cleaned;A useful product-side mitigation would be to quarantine/evict invalid projectless workspace roots across all Desktop state stores, not only
config.toml, and to run internal system-tool probes (ps,ditto,sw_vers,xcode-select, etc.) with absolute paths or a sanitized PATH.@daihao1975-dotcom I've tried deleting the entire .codex folder, no help. I thought it did but then after a moment the CPU climbs back to 140% and
syspolicydis spammed with Codex listings.I guess I'm stuck for now.
@guidedways Deleting the whole
~/.codexdirectory may still miss two parts of the loop I saw locally:code_sign_clone/ Computer Use recreation path, which can be rebuilt after~/.codexis removed.On my machine, the current state is not "zero pressure" either. Under a deliberate multi-agent stress test,
syspolicydstill spiked, but it did not grow monotonically:So this is only a guarded/local-containment result, not proof that the upstream issue is gone. My local acceptance criterion is now: app launches remain usable, and the FD count releases or is reset instead of climbing forever. During heavy Codex usage, the remaining pressure is still real.
If your CPU goes back to ~140% after deleting
~/.codex, I would check these separately from config cleanup:In my case, a dirty launch path showed up as:
TERM_PROGRAM=vscode/VSCODE_*inherited by the Codex GUI process;codex app-server/node_replstill had a long PATH with user/tool directories before/usr/bin:/bin;notifywas recreated to point atSkyComputerUseClient.That makes me think there are at least three amplifiers here: stale workspace/projectless metadata, dirty PATH / bare system-tool spawning, and
code_sign_clone/ Computer Use recreation. Cleaning.codexhelps only the first class, and may immediately recreate the third.In that case, this is precisely what I encountered. There was a non-zero pressure, and
syspolicydwas consistently reaching around 26%-50% of the CPU (not as severe as 200%). Additionally, the entries were _slowed down_ to every two or so seconds under Activity Monitor. For my specific use case, anything above 0% is unfortunately going to impact my work (and sanity) and potentially only exacerbate my anxiety 😆For folks still trying different workarounds: I documented my local investigation and mitigation here: https://github.com/openai/codex/issues/25243#issuecomment-4709140592
This is not a confirmed upstream fix, but on my affected Mac the strongest local evidence was PATH lookup amplification: Codex was invoking some tools by bare command name, and a long user PATH with many mise-managed directories before the system dirs caused repeated SystemPolicy/Gatekeeper work. A narrow PATH shim for the observed commands (
ps,ditto,sw_vers,xcode-select, and my first selectedgit) has kept my machine stable across restart/update/heavy-use checks so far.The newer comments about stale/invalid project roots and
code_sign_clone/.../Codex.app.bundle/Contents/MacOS/Codexstill look important too. My mitigation does not claim to solve every trigger path, but it may help distinguish PATH amplification from the remainingcode_sign_clone/ metadata-probing issues.Adding a sanitized repro/data point. I am deliberately omitting local usernames, home paths, project names, hostnames, account/session IDs, and raw logs.
Current affected machine checked:
26.5.1/ build25F80arm6426.611.61753/ bundle4008This same class of failure is reproducible across three separate Macs here. Common pattern:
syspolicyd, then verifyspctl --assess --type execute --verbose=4 /System/Applications/Calculator.appreturnsaccepted.syspolicydbegins accumulating file descriptors whose path is overwhelmingly:``
text
``/Applications/Codex.app/Contents/MacOS/Codex
syspolicyd, the Codex FD count grew roughly like this within about a minute:``
text
``227 -> 296 -> 651 -> 2335 -> 2535
acceptedtoToo many open files, and unrelated apps cold-launch very slowly or stall.syspolicydrestoresspctlfor unrelated apps. With Codex still closed,syspolicydreturns to a low FD baseline and unrelated apps launch normally.codesign --verify --deep --stricton Codex and affected unrelated apps passes, so this does not look like a corrupt app bundle or a single third-party app issue.sample syspolicydduring the bad state showed work concentrated around the SystemPolicy/YARA/code-signing path, includingcom.apple.security.syspolicy.yaraandSecStaticCodeCreateWithPath.This matches the reports here that Computer Use may be one trigger/amplifier, but it does not appear to be the only one. In this reproduction, the strongest public-safe signal is
syspolicydrepeatedly retaining FDs to the Codex main executable itself.Expected product behavior: Codex should not repeatedly trigger Gatekeeper/SystemPolicy assessment of its own executable or helpers in a way that lets
syspolicydaccumulate unreleased FDs and break system-wide app launching. Any relaunch/helper-validation loop should have backoff/caps, and Desktop should have a safe mode or feature-disable path that avoids high-risk helper/plugin startup while this is being diagnosed.Just saw the following in the middle of work! But we _cannot_ update as the issue isn't resolved.
<img width="876" height="536" alt="Image" src="https://github.com/user-attachments/assets/a8b6071a-fe82-4a58-b457-47182ab21f67" />
@etraut-openai is this still an issue the team is actively looking into? It seems newer updates aren't trying to address this at all
Thank you! This finally worked for me! I'm at
sysprofiled0% !!!!This didn't work for me.
sudo lsof -c syspolicyd | wc -lshows around 2400 items right after startup :(@andrea-sdl ask codex to look at https://github.com/openai/codex/issues/25243#issuecomment-4709140592 and fix the issue for you. It found
27GBworth of items on my mac, cleaned up thepathetc and updated~/.zhrcand it's working beautifully now.I encountered this syspolicyd problem yesterday on a very fresh version:
Version 26.616.71553 • Released Jun 23, 2026
I tried many ways I can find in all comments from all issues I can found but no one works.
Until I found a stray/corrupted .git folder under one of my codex working directory, which contains multiple repos (but it should not have its own .git).
I removed it and everything is fine now.
After open Codex App, syspolicyd will run at ~50% for only couple seconds, not infinitively 150% anymore.
computer use, browsers, etc. are all enabled.
Hope this helps.
Superseded/correction: please do not treat this branch as a fix for this issue.
Later local triage on the same machine found the actual trigger: a malformed trusted workspace root.
~/.codex/config.tomlhad a trusted project entry for/Users/admin, and/Users/admin/.gitwas a broken git shell containing onlygk/config;git -C /Users/admin rev-parse --git-dir --is-inside-work-treefailed withfatal: not a git repository.Moving that broken
.gitdirectory to Trash stopped the storm locally. After a short settle period, the 15ssyspolicydwindow returned 0 rows for:failed to call driverUNIX error exceptionSecTrustCopyAppleTrustAnchorsFailed to generate SecStaticCodeThe
/bin/psbranch may still remove a small PATH-resolution amplifier in app-server code, but it was not the root cause of my reproduction and should not be cherry-picked as the workaround for this issue.Withdrawn / superseded.
Please do not cherry-pick the branch above as a fix for this issue. Later local evidence on the same machine found the real trigger to be a malformed trusted workspace root:
~/.codex/config.tomltrusted/Users/admin, and/Users/admin/.gitwas a broken git shell. Moving that broken.gitto Trash stopped thesyspolicydstorm locally.The branch may still be a narrow hardening improvement for a PATH/
psamplifier, but it is not the root-cause workaround for this report.Confirming @jamguoxiaoqi's finding — a corrupted
.gitfolder was the trigger for me too.Big thanks to @jamguoxiaoqi for spotting this. On my machine (Codex
26.616.71553, macOS) I had the exact same runawaysyspolicydbehavior, and a broken.gitdirectory turned out to be the culprit.The culprit: the root of my workspace had a gutted
.gitdirectory — onlydescriptionandinfo/were left, with noHEAD,config,objects/orrefs/.git statusinside it just returnedfatal: not a git repository. So it looked like a repo to a directory scan, but was actually a dead shell. (My 11 real sub-project repos were all fine — only this top-level one was broken.)Before (with the broken
.git):syspolicydCPU pinned at ~120–170%After (removed the broken
.git):syspolicydCPU steady at 0.0% over repeated samplingFix that worked for me — find the dead
.gitshells and remove them:To be clear, this is a workaround, not a real fix — Codex still shouldn't melt
syspolicydjust because a directory contains a malformed.git. A backoff / safe-mode on repeated signature re-evaluation (as suggested above) still seems like the right long-term fix. But for anyone stuck right now, checking for a corrupted.gitis well worth it.Correction / final local result from the same machine: the Desktop sampler
psevidence below was real, but it was not the root cause of my reproduction.The root trigger turned out to be a malformed trusted workspace root, matching the broken-
.gitreports from @jamguoxiaoqi and @goclaude:~/.codex/config.tomlhad[projects."/Users/admin"] trust_level = "trusted"./Users/admin/.gitexisted but was not a valid git repository. It contained only:git -C /Users/admin rev-parse --git-dir --is-inside-work-treereturned:Temporary workaround that fixed this machine:
Validation after moving the broken
.gitto Trash:node_replwas already disabled on this machine viaCODEX_NODE_REPL_PATH=/usr/bin/false, so that was not sufficient by itself. The useful local order now seems to be:~/.codex/config.toml.$root/.gitexists and whethergit -C "$root" rev-parse --git-dir --is-inside-work-treesucceeds..gitshells to Trash after confirming they are not real repositories.syspolicydlogs over a short window.The earlier Desktop sampler / repeated
psobservation should be treated as an amplifier or follow-up hardening area, not as the primary root cause for this local reproduction.Final correction from my local reproduction: the workaround that actually stopped the storm was removing a malformed
.gitdirectory from a trusted workspace root.What was wrong locally:
but
/Users/admin/.gitwas not a valid git repo:Temporary workaround:
After that, the next 15s
syspolicydwindow went to zero for the storm signatures:So for anyone still seeing this: before chasing
node_repl, Computer Use, PATH, or the Desktop sampler, first inspect the trusted project roots in~/.codex/config.tomland remove malformed.gitshells after confirming they are not real repositories.Adding a temporary mitigation that has been working for my local machine. This is not a fix for the Codex/syspolicyd issue; it just keeps macOS usable while waiting for a real fix.
Environment where I reproduced this:
Local checks showed the usual pattern:
So I added a small
launchdmonitor that samplessyspolicydevery 5 minutes, logs CPU, and optionally restartssyspolicydwhen it crosses a threshold. In my current setup:The script logs entries like:
For
launchdauto-recovery to work, I had to allow only this one passwordless sudo command:The monitor itself runs as a user LaunchAgent and only executes:
when
syspolicydexceeds the CPU threshold and the cooldown has elapsed. This has been enough to prevent the system from getting stuck in the state where unrelated apps fail to launch. Again: this is a workaround only; Codex should not be drivingsyspolicydinto this condition in the first place.Confirming @jamguoxiaoqi's finding — this fixed the same
syspolicydstorm for me on macOS (Codex 26.616.x).My trusted workspace
~/Documents/codexhad a stray broken.gitdirectory (onlyobjects/pack/, noHEAD/config). The real git repo intentionally lives in.git.nosyncfor iCloud. After moving the broken.gitout of the workspace,syspolicyd/trustdCPU dropped back to normal and Codex became usable again.Thank you for posting this — it was the breakthrough after trying many other workarounds.
Adding another anonymized data point from an affected macOS machine.
Environment:
Main app signing was OK in this case:
Local observations before cleanup:
syspolicyd/trustdand heat.syspolicydandtrustdback to 0%.~/.codex/computer-usewas being recreated on Codex launch.computer-use@openai-bundledandchrome@openai-bundleddisabled, Codex restored anotify = ["~/.codex/computer-use/.../SkyComputerUseClient", "turn-ended"]hook on launch and startedSkyComputerUseService.spctlrejected that app, so I removed it as a confounder before comparing Codex behavior.Mitigation steps tried:
~/.codex.chrome@openai-bundled,computer-use@openai-bundled, andrecord-and-replay@openai-bundled./Applications/Codex.appfrom the official DMG while preserving~/.codex.After those steps:
Additional duplicate/root-cause check:
I then checked trusted project roots in
~/.codex/config.toml, based on the broken.gitreports above. One trusted workspace root contained an empty malformed.gitdirectory:I moved that empty
.gitdirectory aside rather than deleting it. This matches the workaround/root cause described by others in this issue, so I am adding it here instead of opening a duplicate issue.The remaining potentially separate issue is that Codex 26.623.61825 still recreates
~/.codex/computer-useand restores theSkyComputerUseClientnotifyhook even when the Computer Use plugin is disabled. That appears related to #30298.I dug into this on macOS 26.2 with ChatGPT/Codex Desktop 26.707.41301 (build 5103) and found a concrete cause for the repeating 32-event bursts.
An Endpoint Security trace shows the Electron sampler running two plain
pscommands./binis 17th in the app’s PATH, so each command tries 16 earlier entries before reaching/bin/ps: 16 × 2 = 32 policy events. The ChatGPT/Codex path in the logs is simply what those children inherit beforeexec; in this capture, the app was not relaunching itself.As a sanity check, I added a symlink to
/bin/psin the user-owned directory already first in PATH. The same app process and sampler kept running, but matching policy events stayed at zero for 120+ seconds andsyspolicyd/trustdsettled.The direct fix seems to be using
/bin/psat both sampler call sites. #24234 shows the same barepscall.Current-build macOS reproduction: malformed trusted
.gitremoval immediately stopssyspolicyd/trustdstormAdding a controlled A/B result from a current Codex Desktop build.
Environment
26.707.72221(build5307)150.0.7871.11526.5.2 (25F84)Before
Codex was running normally, but one explicitly trusted workspace contained an empty malformed Git directory:
The directory existed but contained none of the required Git control files:
git -C <workspace> rev-parse --git-dir --is-inside-work-treereturned:The workspace was explicitly configured with
trust_level = "trusted".Observed sustained load across repeated samples:
A macOS resource report showed
syspolicydhad dirtied approximately 2.15 GB of file-backed memory in its SQLite policy path. A contemporaneous open-file snapshot contained 21 entries for the Codex/ChatGPT main executable and 40 HTTPS connections to Apple17.248.x.xendpoints.The GUI process PATH was only:
Therefore the recently reported bare-
psPATH-search amplification does not match this reproduction.Intervention
I renamed only the empty malformed directory:
I did not restart Codex,
syspolicyd,trustd, or macOS.After
Within approximately one minute:
Both remained at 0% throughout a further two-minute 10-second-interval sample.
syspolicydRSS subsequently fell from about 328 MB to 131 MB while the same Codex Desktop process remained running.A scan of all other currently existing trusted project roots found 10 valid Git repositories and no additional malformed
.gitdirectories.Conclusion
This is a current-build confirmation that an empty/malformed
.gitdirectory under a trusted workspace can trigger the Codex-associated Gatekeeper/SystemPolicy storm. The no-restart A/B result strongly isolates removal of the malformed Git marker as the event that stopped the CPU runaway.Suggested invariant: Codex should not treat the mere existence of
.gitas sufficient. It should validate repository state, bound retries/fallback process creation afterrev-parsefailure, and avoid repeatedly causing executable policy assessments for an invalid workspace.