fix(heartbeat): make phase scheduling active-hours-aware (#75487)#75597
fix(heartbeat): make phase scheduling active-hours-aware (#75487)#75597clawsweeper[bot] merged 8 commits intomainfrom
Conversation
|
Codex review: passed. Summary Reproducibility: yes. Current main can be reproduced with a Next step before merge Security Review detailsBest possible solution: Land this PR through the existing automerge path, keeping the runtime active-hours guard as the final backstop. Do we have a high-confidence way to reproduce the issue? Yes. Current main can be reproduced with a Is this the best way to solve the issue? Yes. The PR is the narrow scheduler-layer fix: it seeks through phase-aligned slots with the existing active-hours predicate, handles config/timezone changes, and leaves the runtime guard intact. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0fad53a19281. |
|
/clawsweeper automerge |
|
🦞🦞 Source: What merged:
Fixups included:
The automerge loop is complete. Automerge progress:
|
cb4e2ae to
ce0e563
Compare
ce0e563 to
02a1283
Compare
* 'main' of https://github.com/openclaw/openclaw: Wizard: bound hatch TUI timeout (#76241) fix(cli): reject codex simple-completion probes fix: memoize plugin descriptor config keys (#76240) fix(heartbeat): make phase scheduling active-hours-aware (#75487) (#75597)
) (openclaw#75597) Summary: - The PR adds active-hours-aware heartbeat phase seeking, wires runner scheduling and config reloads through it, adds scheduler/e2e coverage, and records the user-facing fix in the changelog. - Reproducibility: yes. Current main can be reproduced with a `4h` heartbeat and an `Asia/Shanghai` active-hours window during a quiet-hours restart: main arms raw UTC-phase slots and only skips when the timer fires. ClawSweeper fixups: - Included follow-up commit: fix(heartbeat): recompute schedule when activeHours config changes vi… - Included follow-up commit: fix(heartbeat): add iteration cap to active-hours seek + edge-case tests - Included follow-up commit: chore: clean up redundant code comments - Included follow-up commit: fix(heartbeat): make phase scheduling active-hours-aware (openclaw#75487) - Included follow-up commit: fix(clawsweeper): address review for automerge-openclaw-openclaw-7559… Validation: - ClawSweeper review passed for head 02a1283. - Required merge gates passed before the squash merge. Prepared head SHA: 02a1283 Review: openclaw#75597 (comment) Co-authored-by: Alex Knight <aknight@atlassian.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
) (openclaw#75597) Summary: - The PR adds active-hours-aware heartbeat phase seeking, wires runner scheduling and config reloads through it, adds scheduler/e2e coverage, and records the user-facing fix in the changelog. - Reproducibility: yes. Current main can be reproduced with a `4h` heartbeat and an `Asia/Shanghai` active-hours window during a quiet-hours restart: main arms raw UTC-phase slots and only skips when the timer fires. ClawSweeper fixups: - Included follow-up commit: fix(heartbeat): recompute schedule when activeHours config changes vi… - Included follow-up commit: fix(heartbeat): add iteration cap to active-hours seek + edge-case tests - Included follow-up commit: chore: clean up redundant code comments - Included follow-up commit: fix(heartbeat): make phase scheduling active-hours-aware (openclaw#75487) - Included follow-up commit: fix(clawsweeper): address review for automerge-openclaw-openclaw-7559… Validation: - ClawSweeper review passed for head 02a1283. - Required merge gates passed before the squash merge. Prepared head SHA: 02a1283 Review: openclaw#75597 (comment) Co-authored-by: Alex Knight <aknight@atlassian.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
* 'main' of https://github.com/openclaw/openclaw: Wizard: bound hatch TUI timeout (openclaw#76241) fix(cli): reject codex simple-completion probes fix: memoize plugin descriptor config keys (openclaw#76240) fix(heartbeat): make phase scheduling active-hours-aware (openclaw#75487) (openclaw#75597)
Summary
Fixes #75487.
computeNextHeartbeatPhaseDueMscomputes next-fire times using pure UTC-epoch modular arithmetic.activeHourswas only checked as a runtime execution guard inrunHeartbeatOnce— when a quiet-hours slot was skipped,advanceAgentSchedulecomputed the next slot (also in UTC) which could also be in quiet hours.This caused:
Asia/Shanghai, multiple consecutive phase slots falling outside the active window before the next in-window slotChanges
src/infra/heartbeat-schedule.tsseekNextActivePhaseDueMs()— takes a starting slot and anisActivepredicate, iterates forward through phase-aligned slots (up to a 7-day horizon), and returns the first in-window slot. Falls back to the raw slot if no active slot is found within the horizon (so the runtime guard can still gate execution).src/infra/heartbeat-runner.tsadvanceAgentSchedulenow wraps the computed next-due time withseekNextActivePhaseDueMs, usingisWithinActiveHoursas the predicate.updateConfiginitial scheduling also seeks forward to the first in-window slot on startup/config reload.