fix(heartbeat): constrain 24-hour sentinel to 24:00 only in regex

The previous pattern /^([01]\d|2[0-3]|24):([0-5]\d)$/ matched 24:01-24:59
because the 24 alternative was not restricted to :00. Restructured the regex
so only the literal string "24:00" is accepted as the end-of-day sentinel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Adi 2026-02-19 22:32:05 +00:00 committed by Gustavo Madeira Santana
parent 399781aaca
commit 5d54a2f953
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import type { AgentDefaultsConfig } from "../config/types.agent-defaults.js";
type HeartbeatConfig = AgentDefaultsConfig["heartbeat"];
const ACTIVE_HOURS_TIME_PATTERN = /^([01]\d|2[0-3]|24):([0-5]\d)$/;
const ACTIVE_HOURS_TIME_PATTERN = /^(?:([01]\d|2[0-3]):([0-5]\d)|24:00)$/;
function resolveActiveHoursTimezone(cfg: OpenClawConfig, raw?: string): string {
const trimmed = raw?.trim();