Repository navigation
macOS Codex relaunch loop exhausts syspolicyd file descriptors and blocks app launches #25243
Copy link
Copy link
Open
Labels
appIssues related to the Codex desktop appIssues related to the Codex desktop appbugSomething isn't workingSomething isn't workingperformance
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
appIssues related to the Codex desktop appIssues related to the Codex desktop appbugSomething isn't workingSomething isn't workingperformance
Activity
github-actions commentedon May 30, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-]`Too many files opened` system error due to Codex app[/-][+]`Too many files opened` system error due to **Locked use** in Codex.app[/+]guidedways commentedon May 30, 2026
If I turn off
Locked useunder settings, this stops happening. Actually it's theComputer Useplugin - if I turn this off, it stops.guidedways commentedon May 30, 2026
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.guidedways commentedon May 31, 2026
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 insyspolicydguidedways commentedon Jun 5, 2026
I continue to see this in
Version 26.602.30954 • Released Jun 4, 2026- no difference,26.519.81530is the only working version.guidedways commentedon Jun 5, 2026
@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?
hhcme commentedon Jun 5, 2026
I've encountered this issue as well
etraut-openai commentedon Jun 5, 2026
@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.guidedways commentedon Jun 5, 2026
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.etraut-openai commentedon Jun 5, 2026
If you're still seeing this issue with
26.602.30954+, please use/feedbackto upload logs and post the session ID here.guidedways commentedon Jun 5, 2026
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 😅31 remaining items
guidedways commentedon Jun 18, 2026
Just saw the following in the middle of work! But we cannot update as the issue isn't resolved.
@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
guidedways commentedon Jun 18, 2026
Thank you! This finally worked for me! I'm at
sysprofiled0% !!!!andrea-sdl commentedon Jun 18, 2026
This didn't work for me.
sudo lsof -c syspolicyd | wc -lshows around 2400 items right after startup :(guidedways commentedon Jun 18, 2026
@andrea-sdl ask codex to look at #25243 (comment) 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.jamguoxiaoqi commentedon Jun 24, 2026
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.
apple-ouyang commentedon Jun 24, 2026
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.apple-ouyang commentedon Jun 24, 2026
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.goclaude commentedon Jun 24, 2026
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.apple-ouyang commentedon Jun 24, 2026
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.apple-ouyang commentedon Jun 24, 2026
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.kedoupi commentedon Jun 25, 2026
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.vokal-pe commentedon Jun 25, 2026
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.
nintendomustdie commentedon Jun 29, 2026
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.ilmarioranen commentedon Jul 11, 2026
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.kerimala commentedon Jul 14, 2026
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.