git fails to access tmp directory
Resolved 💬 10 comments Opened Apr 17, 2025 by steipete Closed Aug 7, 2025
💡 Likely answer: A maintainer (jonchurch, contributor)
responded on this thread — see the highlighted reply below.
Is there a way to fix these? I assume this is sandboxing in effect, it makes some git operations to fail.
$ git ls-files -i --exclude-standard
command.stdout (code: 128, duration: 0s)
git: warning: confstr() failed with code 5: couldn't get path of DARWIN_USER_TEMP_DIR; using /tmp instead
git: error: couldn't create cache file '/tmp/xcrun_db-Q5a5z5VJ' (errno=Operation not permitted)
git: warning: confstr() failed with code 5: couldn't get path of DARWIN_USER_TEMP_DIR; using /tmp instead
git: error: couldn't create cache file '/tmp/xcrun_db-EIrGD0DV' (errno=Operation not permitted)
... (2 more lines)
thinking for 17s
10 Comments
Related to #207
Im hoping it would be addressed by something like #378 but this is a new path, not
/var/tmp...can you install version
0.1.2504172351alanpm i @openai/codex@0.1.2504172351and see if it reproduces?Well that build does have a crash, so first make sure you do
mkdir -p ~/.pyenvthen run codexif that version doesnt work, can you pass in
/tmpas a writeable root to codex?codex -w /tmpYou are correct it is sandboxing, which you can see the policies here:
https://github.com/openai/codex/blob/c40f4891d479114b433457574eca041b666571e9/codex-cli/src/utils/agent/sandbox/macos-seatbelt.ts#L17
I am using codex 0.1.2505140839 on OSX and I am getting the same error even when using
codex -w /tmp.It is 100% repeatable when doing a
git commit.Is there a solution for this yet? Let me know if you need more logs or for me to try other steps.
I just installed
codexyesterday and I'm having the same issuesame issue here
macos 15.4.1 (24E263)
updated to
v0.1.2505172129and looks like error is goneI am still getting an error on the latest version when I launch codex with
--approval-mode=full-auto(see the error below). But strangely enough it works as expected if I do not set the approval mode and just manually approve the command.managed to capture fail and success in single thread
looks like when
--no-verifyflag is used, the error won't triggerSame here. Because there is no way to disable sandbox, I solved this by clone this repo and eliminated sandbox in
handle-exec-command.ts. Then installed this local package. Works like a charm.this has been fixed for me, on version
codex-cli 0.0.2505291458Thank you for the feedback! Please try again on the latest version of Codex CLI, as we've been addressing sandboxing and related issues. If the problem persists, feel free to reach out again.