core-agent-ide/codex-cli/src
David Z Hao 75eecb656e
Fix MacOS multiprocessing by relaxing sandbox (#1808)
The following test script fails in the codex sandbox:
```
import multiprocessing
from multiprocessing import Lock, Process

def f(lock):
    with lock:
        print("Lock acquired in child process")

if __name__ == '__main__':
    lock = Lock()
    p = Process(target=f, args=(lock,))
    p.start()
    p.join()
```

with 
```
Traceback (most recent call last):
  File "/Users/david.hao/code/codex/codex-rs/cli/test.py", line 9, in <module>
    lock = Lock()
           ^^^^^^
  File "/Users/david.hao/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/multiprocessing/context.py", line 68, in Lock
    return Lock(ctx=self.get_context())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/david.hao/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/multiprocessing/synchronize.py", line 169, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
  File "/Users/david.hao/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/multiprocessing/synchronize.py", line 57, in __init__
    sl = self._semlock = _multiprocessing.SemLock(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted
```

After reading, adding this line to the sandbox configs fixes things -
MacOS multiprocessing appears to use sem_lock(), which opens an IPC
which is considered a disk write even though no file is created. I
interrogated ChatGPT about whether it's okay to loosen, and my
impression after reading is that it is, although would appreciate a
close look


Breadcrumb: You can run `cargo run -- debug seatbelt --full-auto <cmd>`
to test the sandbox
2025-08-03 06:59:26 -07:00
..
components add: session history viewer (#912) 2025-05-16 12:28:22 -07:00
hooks chore: consolidate model utils and drive-by cleanups (#476) 2025-04-21 12:33:57 -04:00
utils Fix MacOS multiprocessing by relaxing sandbox (#1808) 2025-08-03 06:59:26 -07:00
app.tsx fix: add support for fileOpener in config.json (#911) 2025-05-13 09:45:46 -07:00
approvals.ts fix: check flags to ripgrep when deciding whether the invocation is "trusted" (#1644) 2025-07-21 22:38:50 -07:00
cli-singlepass.tsx fix: standardize filename to kebab-case 🐍➡️🥙 (#302) 2025-04-17 20:25:44 -07:00
cli.tsx feat(ts): provider‑specific API‑key discovery and clearer Azure guidance (#1324) 2025-06-22 17:56:36 -07:00
format-command.ts Back out @lib indirection in tsconfig.json (#111) 2025-04-16 14:16:53 -07:00
parse-apply-patch.ts chore: consolidate patch prefix constants in apply‑patch.ts (#274) 2025-04-17 17:00:30 -07:00
shims-external.d.ts feat: add support for ZDR orgs (#481) 2025-04-22 01:30:16 -07:00
text-buffer.ts fix: input keyboard shortcut opt+delete (#685) 2025-04-30 17:17:13 -07:00
typings.d.ts Initial commit 2025-04-16 12:56:08 -04:00
version.ts fix: always load version from package.json at runtime (#909) 2025-05-12 21:27:15 -07:00