Gemini CLI fixes macOS sandbox crashes by embedding Seatbelt profiles
amelidev · ghdev · 2026-07-28
What changed
This PR fixes a startup crash in Gemini CLI when running in sandbox mode on macOS/gMac environments where the static Seatbelt .sb profiles are missing from the bundle or runfiles.
How it works
- Embeds the six built-in macOS Seatbelt profiles directly in sandboxBuiltinProfiles.ts
- If the physical profile file is missing at runtime, Gemini CLI writes the embedded profile to a randomized temp file under /tmp
- Adds cleanup hooks for exit, SIGINT, SIGTERM, and child-process close / error
- Keeps normal local-dev behavior unchanged when the file is present
Validation
The author says the fix is covered by unit tests and passes the targeted test suite for src/utils/sandbox.test.ts.
More from coding & agent
- 10 open-source repos that let your AI agent reverse-engineer apps and games — victor_explore · 2026-10-16
- The new CTO job: agent management and QA loops, 'cable management' instead of coding — HankYeomans · 2026-10-16
- Why company AI agents go stale: adoption needs in-house knowledge, not just better agents — EdenEmarco177 · 2026-10-16
- Open-source MCP lets coding agents search Obsidian's 9,000-plugin directory before reinventing wheels — pitfa19 · 2026-10-16
- Cheng Lou open-sources Handwired: hand-written weights turn code into training-free neural nets — dotey · 2026-10-16
- Building a portable context vault in Notion so every AI agent knows you from day one — ivanhzhao · 2026-10-16