Files
stack/packages/mosaic/framework/tools/fleet
Jason Woltje 6a80378e73
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was canceled
fix(fleet): heartbeat consistency — honor MOSAIC_HOME + MOSAIC_HEARTBEAT_INTERVAL
F3 milestone 1 — the two pre-existing HB bugs (from #584) flagged in the #590 review:
- writer (start-agent-session.sh): MOSAIC_HEARTBEAT_RUN_DIR now defaults to
  ${MOSAIC_HOME:-$HOME/.config/mosaic}/fleet/run, matching the path `fleet ps`
  reads (heartbeatPath uses the resolved mosaicHome). Fixes false "stale/unknown"
  HB on custom MOSAIC_HOME deployments.
- reader (fleet.ts): new heartbeatIntervalMs() honors MOSAIC_HEARTBEAT_INTERVAL
  (seconds); parseHeartbeat's freshness threshold now matches the writer's actual
  cadence instead of a hardcoded 15s. + vitest coverage.

Validated: custom-home writer dir == reader path; interval 30 -> 30000ms, unset
-> 15000ms; prettier clean.

Refs #542 #588

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 18:16:48 -05:00
..