v7.40.4 macOS: Pulse and menu-bar installs fail when ~/Library/LaunchAgents does not exist, with a misleading "port did not bind" error
Version
LifeOS 7.40.4 (tag commit be9e8ef) / Pulse
What is broken
On a macOS account that has no ~/Library/LaunchAgents directory yet (fresh user accounts and fresh VM images), installing the opt-in pulse and pulse-menubar components fails. The Pulse installer writes its plist into that directory without creating it, launchctl load then fails, and manage.sh reports a misleading "installed but port 31337 did not bind" error that points at a stderr log that was never created. Creating the directory by hand and re-running the same command makes both components install and run. The TypeScript installers already guard this (TOOLS/InstallWorkSweep.ts:106, TOOLS/InstallDerivedSync.ts:100 create the directory before writing); the shell installers do not.
Where (file:line)
LIFEOS/PULSE/manage.sh:139(install) and:46(start):sed ... > "$PLIST_DST"withPLIST_DSTunder~/Library/LaunchAgents, nomkdir -p.LIFEOS/PULSE/MenuBar/install.sh:67: the same unguarded write, underset -euo pipefail.LIFEOS/PULSE/manage-deriver.sh:52: the same pattern (not exercised in this repro).
Repro on a clean tree
# macOS, account where ~/Library/LaunchAgents does not exist
ls ~/Library/LaunchAgents # No such file or directory
LIFEOS_VERSION=7.40.4 LIFEOS_SKIP_ALIAS=1 CLAUDECODE=1 bash install.sh
cd ~/.claude/skills/LifeOS
bun Tools/InstallSettings.ts --apply
cp install/CLAUDE.template.md ~/.claude/CLAUDE.md
bun Tools/DeployCore.ts --apply && bun Tools/ScaffoldUser.ts --apply && bun Tools/LinkUser.ts --apply
bun Tools/DeployComponents.ts --apply --components pulse,pulse-menubar
curl -s -o /dev/null -w '%{http_code}\n' 127.0.0.1:31337/healthz # 000
bash -x ~/.claude/LIFEOS/PULSE/manage.sh installDeployComponents returns ok: false with "error": "Command failed: bun /Users/you/.claude/LIFEOS/TOOLS/Services.ts install --only pulse --yes\n1 service install(s) FAILED." (and the same for pulse-menubar). The trace shows:
/Users/you/.claude/LIFEOS/PULSE/manage.sh: line 139: /Users/you/Library/LaunchAgents/com.lifeos.pulse.plist: No such file or directory
+ launchctl load /Users/you/Library/LaunchAgents/com.lifeos.pulse.plist
Load failed: 5: Input/output error
ERROR: LifeOS Pulse installed but port 31337 did not bind within 10s.
Check: tail -50 /Users/you/.claude/LIFEOS/PULSE/logs/pulse-stderr.logThe referenced pulse-stderr.log does not exist at that point.
Negative control
On unpatched 7.40.4 (macOS 15.7.3 arm64, bun 1.4.2), with ~/Library/LaunchAgents absent, both components fail as above. On the same machine and install, after only mkdir -p ~/Library/LaunchAgents, the identical DeployComponents command returns "applied": true with "probe": {"name": "pulse-loaded", "passed": true} for pulse and the equivalent for pulse-menubar; launchctl print gui/$(id -u)/com.lifeos.pulse succeeds, /healthz returns 200 {"status":"ok","reasons":[]}, and ~/Applications/LifeOS Pulse.app is running. The menu-bar failure was not traced line by line; it shares the missing directory and is cleared by the same step.
Suggested fix
Untested: create the directory before each plist write (mkdir -p "$(dirname "$PLIST_DST")") in manage.sh (both branches), MenuBar/install.sh, and manage-deriver.sh, matching what InstallWorkSweep.ts and InstallDerivedSync.ts already do.
Before submitting
- I searched open and closed issues for this defect.
- The repro runs against a clean tree of the version above, not against my modified install.
- I removed personal data from the pasted output — real names, absolute home paths, tokens, my own content.
Source: danielmiessler/LifeOS