You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sonny triggers from different HOMEs share one launchd domain and label namespace #453
On macOS, sonny/src/trigger.rs writes a trigger's plist under $HOME/Library/LaunchAgents. It then bootstraps the plist into gui/<uid> with the label me.lydakis.agent.trigger.<name>. The domain and the label depend only on the uid, never on HOME. So two Sonny setups under one user, each with its own HOME, store and daemon, share both the launchd domain and the label namespace. Test HOMEs and evals are the usual case.
Seen in a role eval (bench/role_eval.py): each run gets its own fake HOME, daemon and socket, yet triggers its leads added (shop.lead.next, a weekly reminder) were loaded in the real user's gui/<uid>. They were unloaded before they fired. What can go wrong:
A job from a throwaway HOME stays loaded in the real user's launchd after its HOME is deleted, and fires into nothing or starts a daemon there.
Two HOMEs with a trigger of the same name overwrite each other's job, or one's rm boots out the other's.
A test HOME can replace or remove a real trigger of the same name.
Options:
Put something unique to the store or HOME in the label, such as a short hash of the store id (me.lydakis.agent.trigger.<hash>.<name>), so each setup owns its labels. That costs a one-way migration of existing labels.
A switch that keeps triggers out of launchd and systemd, for tests and evals, where the trigger runs from a scheduler the HOME owns or not at all.
Both: (1) for correctness, (2) so evals never touch the user's session.
Until then, bench/role_eval.py will remove each run's triggers when the run ends.
Activity
bench: role eval removes each run's triggers when it ends (#453)
bench: role eval removes each run's triggers when it ends (#453) (#455)
Triggers: each HOME has labels of its own
Trigger tests expect an ended one-off's row; memory eval gets a day-o…