Sometimes my BSD Sockets code would present the local network alert correctly and everything would be fine.
Interesting, because we just saw this yesterday too (for the first time ever). The cron job runs overnight and when I Screen Shared to the Mac yesterday morning there was the permission screen waiting for me to press Allow. I pressed Allow but then was too busy with other things.
Looking today, the UI in System Settings now has an entry with a weird icon and the name of the Mac. Right-clicking to Reveal in Finder fails. It's like a zombie entry that falls back to a stupid icon and stupid string. I've just rebooted, and now that zombie entry is gone.
I’m not sure how this translates to your setup. You’re having problems with a tool coming from Homebrew, meaning its hard to change its exit behaviour. However, if you were able to do that, it’d be interesting to see how it affects the final behaviour of the system.
The actual thing we are doing is a nightly build script which uses svn/subversion (built by MacPorts) to get our latest code every night then build it with xcodebuild.
Perhaps when there are many/large file changes svn runs slowly enough to make this happen or not? In all our testing, the working copy was already up-to-date and thus it ran fast. Or maybe we could use Network Link Conditioner to force everything to run like molasses? Then again, since the local connection is rejected by the OS immediately, neither of those may help.
MacPorts can be told to build from source. I suppose I could hack svn to add a sleep()...