macOS: avoid launchd startup crash loops#81726
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. source-backed rather than live: current main writes boolean Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Make service audit/doctor treat boolean Do we have a high-confidence way to reproduce the issue? Yes, source-backed rather than live: current main writes boolean Is this the best way to solve the issue? No, not as currently patched. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 11017c93cf14. Re-review progress:
|
|
Broad verification update:
|
|
Closing this branch, but not dropping the problem. #73673 is still a real macOS launchd issue; this PR is just too stale to be the safe way to land it now. I’m going to treat the right next step as a fresh, narrow PR against current main that only addresses the crash-loop policy, with updated launchd/service-audit tests and no carried-over stale changelog noise. |
Summary
KeepAlive.SuccessfulExit=trueinstead of respawning every non-zero startup failure.ExitTimeOut,ProcessType,ThrottleInterval, andUmasklaunchd hardening.Fixes #73673.
Verification
Behavior addressed: non-zero launchd startup failures stay stopped for inspection while clean-exit update/restart handoffs still relaunch.
Real environment tested: local Codex worktree on macOS with targeted unit/docs proof; no live launchd smoke yet.
Exact steps or command run after this patch:
PATH=/Users/buns/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH node scripts/run-vitest.mjs src/daemon/launchd.test.ts src/daemon/service-audit.test.ts;PATH=/Users/buns/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH pnpm exec oxfmt --check --threads=1 src/daemon/launchd-plist.ts src/daemon/launchd.test.ts src/daemon/service-audit.ts src/daemon/service-audit.test.ts;PATH=/Users/buns/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH pnpm docs:list;git diff --check.Evidence after fix: targeted Vitest passed 2 files, 86 tests passed; oxfmt check passed; docs:list completed; git diff whitespace check passed.
Observed result after fix: generated launchd plist contains
KeepAlivedict withSuccessfulExit=trueand still includes shutdown/process/throttle policy; service audit accepts that canonical policy and rejects missing KeepAlive.What was not tested: live macOS LaunchAgent crash-loop smoke and broad Testbox
pnpm check:changedare still pending for the full four-slice queue.