From 5d54a2f9535eb2b588141a90d5c3b38dc4bcc4d7 Mon Sep 17 00:00:00 2001 From: Adi Date: Thu, 19 Feb 2026 22:32:05 +0000 Subject: [PATCH] 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 --- src/infra/heartbeat-active-hours.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infra/heartbeat-active-hours.ts b/src/infra/heartbeat-active-hours.ts index 1d9f1d3362d..91341b69a8b 100644 --- a/src/infra/heartbeat-active-hours.ts +++ b/src/infra/heartbeat-active-hours.ts @@ -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();