fix(fleet): heartbeat consistency — MOSAIC_HOME path + configurable interval #595

Merged
jason.woltje merged 1 commits from feat/f3-pi-harness-hb into main 2026-06-21 23:25:54 +00:00
Owner

Closes #594 · F3 milestone 1 · refs #588. The 2 pre-existing HB bugs (from #584) you flagged in the #590 review:

  • writer (start-agent-session.sh): HB run-dir now honors MOSAIC_HOME -> matches the path fleet ps reads (no more false stale/unknown on custom homes).
  • reader (fleet.ts): heartbeatIntervalMs() honors MOSAIC_HEARTBEAT_INTERVAL; freshness threshold tracks the writer's real cadence. + vitest test.

Validated locally (custom-home paths match; interval 30->30000ms). prettier clean. Local typecheck not run (no node_modules) — CI verifies.

NOTE: test-start-agent-session.sh has a pre-existing env-dependent failure (Test 1 'agent workdir mismatch' — fails identically on origin/main, unrelated to HB) that aborts before the HB tests; flagging for the F3 harness-tooling pass.

Closes #594 · F3 milestone 1 · refs #588. The 2 pre-existing HB bugs (from #584) you flagged in the #590 review: - **writer** (start-agent-session.sh): HB run-dir now honors `MOSAIC_HOME` -> matches the path `fleet ps` reads (no more false stale/unknown on custom homes). - **reader** (fleet.ts): `heartbeatIntervalMs()` honors `MOSAIC_HEARTBEAT_INTERVAL`; freshness threshold tracks the writer's real cadence. + vitest test. Validated locally (custom-home paths match; interval 30->30000ms). prettier clean. Local typecheck not run (no node_modules) — CI verifies. NOTE: `test-start-agent-session.sh` has a **pre-existing** env-dependent failure (Test 1 'agent workdir mismatch' — fails identically on origin/main, unrelated to HB) that aborts before the HB tests; flagging for the F3 harness-tooling pass.
jason.woltje added 1 commit 2026-06-21 23:16:51 +00:00
fix(fleet): heartbeat consistency — honor MOSAIC_HOME + MOSAIC_HEARTBEAT_INTERVAL
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was canceled
6a80378e73
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>
jason.woltje merged commit 60a309d5a4 into main 2026-06-21 23:25:54 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#595