Windows: no autostart for Pulse or background services (launchd-only) — working Task Scheduler pattern included
Environment: LifeOS 7.28.3, Windows 11, Bun via %USERPROFILE%\.bun\bin\bun.exe
Every service installer targets macOS launchd (manage.sh, Services.ts, the com.lifeos.* jobs). On Windows nothing boots Pulse at logon, so the dashboard, /notify, and /reload are all silently dead until someone starts bun run pulse.ts by hand — and WorkSweep, the deriver, and synthesis never run at all.
Working pattern (running on my install, no admin rights needed) — two files in LIFEOS/PULSE/:
PulseStart.ps1 — idempotent hidden launcher:
$pulseDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$bun = Join-Path $env:USERPROFILE ".bun\bin\bun.exe"
try {
$probe = Invoke-WebRequest -Uri "http://localhost:31337/" -UseBasicParsing -TimeoutSec 2
if ($probe.StatusCode -eq 200) { exit 0 } # already running
} catch { }
if (-not $env:HOME) { $env:HOME = $env:USERPROFILE } # see #1729 — pulse.ts crashes without HOME
Start-Process -FilePath $bun -ArgumentList "run", "pulse.ts" -WorkingDirectory $pulseDir -WindowStyle Hidden
manage.ps1 — install registers a current-user scheduled task (logon trigger, restart-on-failure):
$taskAction = New-ScheduledTaskAction -Execute "powershell.exe" `
-Argument "-NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$startScript`"" `
-WorkingDirectory $pulseDir
$trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries `
-StartWhenAvailable -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)
Register-ScheduledTask -TaskName "LifeOS Pulse" -Action $taskAction -Trigger $trigger -Settings $settings -Force
(Gotcha for anyone adapting this: don't name the action variable $Action if your script has a param($Action) — PowerShell variables are case-insensitive and Register-ScheduledTask gets handed the string.)
Verified end-to-end: task-start → Pulse answers on :31337. Happy to PR this as manage.ps1/PulseStart.ps1 alongside manage.sh, plus the same pattern generalized for WorkSweep/deriver if there's interest.
Related: #1694 (Windows unlaunchable), #1729 (HOME resolution), #1730 (PATH false negatives).
Follow-up from live testing: the scheduled task also needs PATH augmented, or Pulse boots but its cron/voice subsystems fail with /bin/bash: bun: command not found (Task Scheduler sessions don't inherit the user's PATH additions). Add to PulseStart.ps1 before launching bun:
$env:PATH = "$(Join-Path $env:USERPROFILE '.bun\bin');C:\Program Files\Git\usr\bin;$env:PATH"
Verified: voice notifications (local Kokoro TTS) and cron jobs both work under the task after this.
Thanks @umair-a11y — this fills a real gap, since Windows had no autostart at all. I took your PulseStart.ps1 and manage.ps1 in as an additive Windows path; that install path is contributor-verified and doesn't touch the macOS flow. The extra verbs we layered on top aren't verified on Windows yet, so I'm not claiming those work. Ships next release. Closing since the public repo is generated from the source.