fix(mac): keep launch-at-login app running#102465
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 519dd99247
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ### Fixes | ||
|
|
||
| - **macOS launch at login:** keep an already-loaded Mac app job running while status hydration refreshes its plist, preventing startup from unloading itself. |
There was a problem hiding this comment.
Remove the unreleased changelog edit
AGENTS.md says CHANGELOG.md is release-only and should not be edited for normal fixes because release generation owns it. This commit is a normal macOS fix, so landing this manual entry risks release-note drift or duplication when the generated changelog is produced; keep the release-note context in the commit/PR body instead.
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 2:48 AM ET / 06:48 UTC. Summary PR surface: Other +32. Total +32 across 2 files. Reproducibility: yes. source inspection gives a high-confidence path: AppState can hydrate launchAtLogin after initialization and call the current enable path, which bootout/bootstrap/kickstarts an already loaded app job. I did not run a live macOS login-cycle reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused LaunchAgentManager change after maintainer review and exact-head macOS/CI gates, keeping release-note context in PR or merge metadata rather than CHANGELOG.md. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence path: AppState can hydrate launchAtLogin after initialization and call the current enable path, which bootout/bootstrap/kickstarts an already loaded app job. I did not run a live macOS login-cycle reproduction in this read-only review. Is this the best way to solve the issue? Yes, this is the best fix shape among the inspected options: keeping the loaded-job guard inside LaunchAgentManager preserves the launchd owner boundary and covers startup hydration without adding AppState-specific suppression. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f91f6c95840. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Other +32. Total +32 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
* fix(mac): avoid launch-agent self-reload * chore: leave release changelog generation * style(mac): use conditional expression
What Problem This Solves
Fixes an issue where users launching the macOS app at login could have the app unload itself during startup when the launch-at-login toggle hydrated from launchd state.
Why This Change Was Made
The app now refreshes the persisted launch-agent plist while treating an already-loaded job as active state, skipping only the destructive bootout/bootstrap cycle. The loaded-state check queries launchd independently from plist presence, preserving the normal off/on toggle path.
User Impact
The macOS app remains running after launch-at-login startup instead of disappearing and leaving its login job unloaded.
Evidence
ai.openclaw.maclaunched the app, which rewrote its plist, booted itself out, exited, and left no loaded job.state = runningwith one OpenClaw process and the plist still present after startup hydration.swift test --package-path apps/macos --filter LaunchAgentManagerTests— 7 tests passed..agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output— clean; no accepted/actionable findings.