mirror of
https://github.com/utmapp/utmapp-bot.git
synced 2026-12-01 14:02:03 -10:00
macOS attributes a dispatched session's local-network connections (SSH to the VMs) to the LaunchAgent's own program. With Homebrew's Python as that program the Local Network grant did not hold (Allow helped only the running process), so dispatcher restarts cut sessions off from the VMs. Apple programs are exempt only with no non-Apple program (claude) between them and the agent, so the system Python would not help either. The dispatcher and the GitHub poller now run under "UTM Bot Agent", a small ad-hoc signed app (no certificate needed) that spawns the real command and waits, so it stays the responsible process. It is linked with a random build UUID and registered with Launch Services before its first run: macOS matches a blocked process to an app by that UUID, and two launchers built alike would share it (no prompt, still blocked). It is rebuilt only when its source or build recipe changes. Tested on macOS 27: the grant holds across fresh launches. db-setup and github-setup build it and, while the user is at the Mac, ask for everything sessions need in a one-shot job under it: Local Network, controlling UTM (its Info.plist carries the Apple Events usage string, without which macOS refuses silently), Screen Recording, and UTM's settings in its container. That last one has no dialog and its per-app switch does not stick, so setup checks real read/write access (`defaults export` reads an unreadable domain as empty), opens Full Disk Access and shows the launcher in Finder. `db-setup --permissions` asks again. load_agent retries bootstrap while a booted-out agent is still exiting. Co-Authored-By: Claude Opus 5.5 <[email protected]>