NousResearch/hermes-agent · warning · BlueprintFillError

unknown day {day!r}

Error message

unknown day {day!r}

What it means

BlueprintFillError: the template has {dow}, no `recurrence` was given, but a `day` value was supplied that is not a key in _DAY_TO_DOW after lowercasing. Only recognized weekday names map to cron day-of-week numbers.

Source

Thrown at cron/blueprint_catalog.py:722

        m = _TIME_RE.match(str(time_val).strip())
        if not m:
            raise BlueprintFillError(f"invalid time {time_val!r} — use HH:MM (24h)")
        repl["hour"] = str(int(m.group(1)))
        repl["minute"] = str(int(m.group(2)))

    # weekday set -> dow
    if "{dow}" in sched:
        if "recurrence" in values:
            preset = str(values.get("recurrence", "everyday")).lower()
            if preset not in WEEKDAY_PRESETS:
                raise BlueprintFillError(
                    f"unknown recurrence {preset!r} — one of {', '.join(WEEKDAY_PRESETS)}"
                )
            repl["dow"] = WEEKDAY_PRESETS[preset]
        elif "day" in values:
            day = str(values.get("day", "")).lower()
            if day not in _DAY_TO_DOW:
                raise BlueprintFillError(f"unknown day {day!r}")
            repl["dow"] = _DAY_TO_DOW[day]
        else:
            repl["dow"] = "*"

    # interval (minutes) for */N schedules
    if "{interval_min}" in sched:
        iv = str(values.get("interval_min", "")).strip()
        if not iv.isdigit() or int(iv) <= 0:
            raise BlueprintFillError(f"invalid interval {iv!r} — minutes as a positive integer")
        repl["interval_min"] = iv

    # Any remaining {slot} placeholders are filled verbatim from validated
    # enum/text slot values (e.g. an hour-range window). Enum options have
    # already been checked in fill_blueprint, so these are safe to interpolate.
    for name in re.findall(r"\{(\w+)\}", sched):
        if name not in repl and name in values:
            repl[name] = str(values[name])

View on GitHub (pinned to c896c09c42)

Solutions

  1. Use the full English weekday name, lowercase is fine: 'monday', 'tuesday', ...
  2. For multi-day patterns use `recurrence` presets or a free-text `schedule` value

Example fix

# before
fill_blueprint(bp, {"time": "07:15", "day": "mon"})
# BlueprintFillError: unknown day 'mon'

# after
fill_blueprint(bp, {"time": "07:15", "day": "monday"})
Defensive patterns

Strategy: validation

Validate before calling

from cron.blueprint_catalog import _DAY_TO_DOW

def valid_day(d: str) -> bool:
    return d.lower() in _DAY_TO_DOW

Try / catch

try:
    spec = fill_blueprint(bp, values)
except BlueprintFillError as e:
    if str(e).startswith("unknown day"):
        values["day"] = resolve_weekday(values["day"])  # 'mon' -> 'monday' via difflib
        spec = fill_blueprint(bp, values)
    else:
        raise

Prevention

When it happens

Trigger: fill_blueprint with day='morning', day='monday-friday', day='tues', or day='' on a {dow} template without recurrence.

Common situations: Abbreviated or misspelled weekday names; passing an interval or phrase in the day slot; localization ('lundi').

Related errors


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/514d68292111e49e. Report an issue: GitHub.