fix(host-service): attempt daemon auto-update even when live sessions are present
Summary
Background daemon auto-update deferred whenever the org had any alive PTY session (live_sessions_present) and never retried until the next host-service restart. For a busy org this means auto-update effectively never runs and the user has to click Update daemon manually (which is how the v1.16.0-era 0.2.5 daemons stayed behind after canary moved to 0.2.6).
The gate protected nothing: update() is the non-destructive fd-handoff (live sessions move to the successor, original shell PIDs survive), and on failure the predecessor keeps running with updatePending still set and the failure surfaced in Settings.
runAutoUpdatenow goes straight tostartUpdate(); removed thelistSessionsprelude and thelive_sessions_present/session_list_unavailabledefer paths- Deleted the now-dead
deferAutoUpdate,countAliveSessions, andAUTO_UPDATE_SESSION_LIST_TIMEOUT_MS - Existing
updateInFlightcoalescing still prevents an auto-update racing a manual click
Test Plan
- Replaced the defer test with "attempts the handoff even when live sessions are present" (still seeds a live session; fails if a session gate is reintroduced, verified by mutating the impl)
-
bun test src/daemon/DaemonSupervisor.test.ts51/51 pass - host-service typecheck and
bun run lintclean
Summary by cubic
Auto-update now runs even when live PTY sessions are active, so busy orgs no longer get stuck on old daemons. The handoff is still non-destructive; if it fails, the predecessor keeps running.
- Bug Fixes
runAutoUpdatecallsstartUpdate()directly; removed session list gating and defer paths.- Deleted dead code:
deferAutoUpdate,countAliveSessions,AUTO_UPDATE_SESSION_LIST_TIMEOUT_MS. - Existing
updateInFlightcoalescing still prevents races with manual updates.