Skip to content

fix(heartbeat): keep stable phase scheduling#857

Open
badgerbees wants to merge 1 commit intonextlevelbuilder:devfrom
badgerbees:fix/heartbeat-stable-phase
Open

fix(heartbeat): keep stable phase scheduling#857
badgerbees wants to merge 1 commit intonextlevelbuilder:devfrom
badgerbees:fix/heartbeat-stable-phase

Conversation

@badgerbees
Copy link
Copy Markdown
Contributor

Summary

Keep heartbeat runs on a stable phase by advancing from the previous scheduled slot instead of resetting to now + interval after each run.

The old bug was that late completions could drift the schedule and gradually bunch agents back together instead of preserving the per-agent spread.

Type

  • Feature
  • Bug fix
  • Hotfix (targeting main)
  • Refactor
  • Docs
  • CI/CD

Target Branch

dev

Checklist

  • go build ./... passes
  • go build -tags sqliteonly ./... passes (if Go changes)
  • go vet ./... passes
  • Tests pass: go test -race ./...
  • Web UI builds: cd ui/web && pnpm build (if UI changes)
  • No hardcoded secrets or credentials
  • SQL queries use parameterized $1, $2 (no string concat)
  • New user-facing strings added to all 3 locales (en/vi/zh)
  • Migration version bumped in internal/upgrade/version.go (if new migration)

Test Plan

Validated the heartbeat scheduler with focused Go tests in internal/store, internal/heartbeat, and internal/gateway/methods. The new regression tests cover deterministic initial staggering, stable-phase advancement from the prior scheduled slot, and catch-up behavior when runs are late.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant