{"record":{"id":"a4892b141c161599","repo":"NousResearch/hermes-agent","slug":"invalid-time-time-val-r-use-hh-mm-24h","errorCode":null,"errorMessage":"invalid time {time_val!r} — use HH:MM (24h)","messagePattern":"invalid time (.+?) — use HH:MM \\(24h\\)","errorType":"validation","errorClass":"BlueprintFillError","httpStatus":null,"severity":"warning","filePath":"cron/blueprint_catalog.py","lineNumber":706,"sourceCode":"\ndef _resolve_schedule(blueprint: AutomationBlueprint, values: Dict[str, Any]) -> str:\n    \"\"\"Fill the schedule_template placeholders from resolved slot values.\"\"\"\n    sched = blueprint.schedule_template\n\n    # A free-text `schedule` slot passes through verbatim (full flexibility).\n    if \"schedule\" in values and values[\"schedule\"]:\n        return str(values[\"schedule\"])\n\n    repl: Dict[str, str] = {}\n\n    # time -> minute/hour\n    time_val = values.get(\"time\")\n    if \"{minute}\" in sched or \"{hour}\" in sched:\n        if not time_val:\n            raise BlueprintFillError(\"a time is required\")\n        m = _TIME_RE.match(str(time_val).strip())\n        if not m:\n            raise BlueprintFillError(f\"invalid time {time_val!r} — use HH:MM (24h)\")\n        repl[\"hour\"] = str(int(m.group(1)))\n        repl[\"minute\"] = str(int(m.group(2)))\n\n    # weekday set -> dow\n    if \"{dow}\" in sched:\n        if \"recurrence\" in values:\n            preset = str(values.get(\"recurrence\", \"everyday\")).lower()\n            if preset not in WEEKDAY_PRESETS:\n                raise BlueprintFillError(\n                    f\"unknown recurrence {preset!r} — one of {', '.join(WEEKDAY_PRESETS)}\"\n                )\n            repl[\"dow\"] = WEEKDAY_PRESETS[preset]\n        elif \"day\" in values:\n            day = str(values.get(\"day\", \"\")).lower()\n            if day not in _DAY_TO_DOW:\n                raise BlueprintFillError(f\"unknown day {day!r}\")\n            repl[\"dow\"] = _DAY_TO_DOW[day]\n        else:","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/cron/blueprint_catalog.py#L688-L724","documentation":"BlueprintFillError: a `time` value was supplied but it does not match _TIME_RE (defined at cron/blueprint_catalog.py:682 as ^([01]?\\d|2[0-3]):([0-5]\\d)$). Only strict 24h HH:MM with hours 0-23 and minutes 00-59 is accepted; '9am', '9:5', '25:00', and '09:30pm' all fail.","triggerScenarios":"Calling fill_blueprint for a {hour}/{minute} template with time='7am', time='9:5', time='23:59:00', or time='24:00'.","commonSituations":"Users typing 12-hour times with am/pm; dropping the leading zero on minutes; including seconds; midnight written as 24:00 instead of 00:00.","solutions":["Use zero-optional hours but two-digit minutes in 24h: '09:30', '9:30', '00:00'","Convert 12-hour input before submitting: 7pm -> '19:00'","Pre-validate with the same regex: re.match(r'^([01]?\\d|2[0-3]):([0-5]\\d)$', t)"],"exampleFix":"# before\nfill_blueprint(bp, {\"time\": \"7:30pm\"})\n# BlueprintFillError: invalid time '7:30pm' — use HH:MM (24h)\n\n# after\nfill_blueprint(bp, {\"time\": \"19:30\"})","handlingStrategy":"validation","validationCode":"import re\nfrom cron.blueprint_catalog import _TIME_RE\n\ndef valid_time(t: str) -> bool:\n    return bool(_TIME_RE.match(t.strip()))","typeGuard":null,"tryCatchPattern":"try:\n    spec = fill_blueprint(bp, values)\nexcept BlueprintFillError as e:\n    if str(e).startswith(\"invalid time\"):\n        values[\"time\"] = normalize_to_24h(values[\"time\"])  # parse '7pm' -> '19:00'\n        spec = fill_blueprint(bp, values)\n    else:\n        raise","preventionTips":["Normalize user time input to 24h HH:MM before calling fill_blueprint","Reject seconds and am/pm suffixes in the form layer","Reuse _TIME_RE client-side so validation matches the server exactly"],"tags":["cron","blueprint","validation","time-format"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}