fix(macOS): use launchctl unload/load instead of stop/start in handlers to ensure plist updates are applied

This commit is contained in:
Haitao Pan 2026-06-21 18:48:20 +08:00
parent a5db649802
commit 68206296f4
4 changed files with 12 additions and 12 deletions

View File

@ -12,12 +12,12 @@
when: ansible_os_family != 'Darwin'
- name: Restart acp codex on macOS
ansible.builtin.command: "launchctl stop plus.svc.xworkspace.acp.codex"
register: launchctl_stop
ansible.builtin.command: "launchctl unload {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.codex.plist"
register: launchctl_unload
failed_when: false
changed_when: false
notify: Start acp codex on macOS
- name: Start acp codex on macOS
ansible.builtin.command: "launchctl start plus.svc.xworkspace.acp.codex"
ansible.builtin.command: "launchctl load -w {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.codex.plist"
changed_when: false

View File

@ -12,12 +12,12 @@
when: ansible_os_family != 'Darwin'
- name: Restart acp gemini on macOS
ansible.builtin.command: "launchctl stop plus.svc.xworkspace.acp.gemini"
register: launchctl_stop
ansible.builtin.command: "launchctl unload {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.gemini.plist"
register: launchctl_unload
failed_when: false
changed_when: false
notify: Start acp gemini on macOS
- name: Start acp gemini on macOS
ansible.builtin.command: "launchctl start plus.svc.xworkspace.acp.gemini"
ansible.builtin.command: "launchctl load -w {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.gemini.plist"
changed_when: false

View File

@ -12,12 +12,12 @@
when: ansible_os_family != 'Darwin'
- name: Restart acp hermes on macOS
ansible.builtin.command: "launchctl stop plus.svc.xworkspace.acp.hermes"
register: launchctl_stop
ansible.builtin.command: "launchctl unload {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.hermes.plist"
register: launchctl_unload
failed_when: false
changed_when: false
notify: Start acp hermes on macOS
- name: Start acp hermes on macOS
ansible.builtin.command: "launchctl start plus.svc.xworkspace.acp.hermes"
ansible.builtin.command: "launchctl load -w {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.hermes.plist"
changed_when: false

View File

@ -12,12 +12,12 @@
when: ansible_os_family != 'Darwin'
- name: Restart acp opencode on macOS
ansible.builtin.command: "launchctl stop plus.svc.xworkspace.acp.opencode"
register: launchctl_stop
ansible.builtin.command: "launchctl unload {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.opencode.plist"
register: launchctl_unload
failed_when: false
changed_when: false
notify: Start acp opencode on macOS
- name: Start acp opencode on macOS
ansible.builtin.command: "launchctl start plus.svc.xworkspace.acp.opencode"
ansible.builtin.command: "launchctl load -w {{ ansible_env.HOME }}/Library/LaunchAgents/plus.svc.xworkspace.acp.opencode.plist"
changed_when: false