Hmbown/CodeWhale · error · anyhow::Error
Invalid BYDAY value '{other}'
Error message
Invalid BYDAY value '{other}' What it means
parse_byday rejects any BYDAY token that is not one of the two-letter codes MO TU WE TH FR SA SU after trimming and uppercasing. It fires while parsing HOURLY or WEEKLY rrules, before any schedule object is built. Ordinal prefixes (1MO, -1SU), full day names, and numeric weekday codes are all unsupported.
Source
Thrown at crates/tui/src/automation_manager.rs:590
fn resolve_local_datetime<Tz: TimeZone>(
timezone: &Tz,
naive: NaiveDateTime,
) -> Option<DateTime<Tz>> {
timezone.from_local_datetime(&naive).earliest()
}
fn parse_byday(value: &str) -> Result<Vec<Weekday>> {
let mut days = Vec::new();
for token in value.split(',') {
let day = match token.trim().to_ascii_uppercase().as_str() {
"MO" => Weekday::Mon,
"TU" => Weekday::Tue,
"WE" => Weekday::Wed,
"TH" => Weekday::Thu,
"FR" => Weekday::Fri,
"SA" => Weekday::Sat,
"SU" => Weekday::Sun,
other => bail!("Invalid BYDAY value '{other}'"),
};
if !days.contains(&day) {
days.push(day);
}
}
Ok(days)
}
fn parse_once_schedule(parts: &BTreeMap<String, String>) -> Result<AutomationSchedule> {
for key in parts.keys() {
if key != "FREQ" && key != "AT" {
bail!("Unsupported RRULE field '{key}' for ONCE. Allowed: FREQ,AT");
}
}
let raw_at = parts
.get("AT")
.ok_or_else(|| anyhow::anyhow!("ONCE schedules require AT"))?;
let at = parse_once_at(raw_at)?;View on GitHub (pinned to 0c42157ee5)
Solutions
- Use exactly the two-letter codes: FREQ=WEEKLY;BYDAY=MO,WE,FR
- Comma-separate multiple days (surrounding whitespace is trimmed)
- Remove ordinal prefixes like 1MO or -1SU; this scheduler has no nth-weekday concept
- Validate with parse_rrule before persisting the rrule
Example fix
// before rrule = "FREQ=WEEKLY;BYDAY=MON,WED;BYHOUR=9;BYMINUTE=0" // after rrule = "FREQ=WEEKLY;BYDAY=MO,WE;BYHOUR=9;BYMINUTE=0"
Defensive patterns
Strategy: validation
Validate before calling
fn valid_byday(value: &str) -> bool {
const OK: [&str; 7] = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"];
!value.is_empty()
&& value.split(',').all(|t| OK.contains(&t.trim().to_ascii_uppercase().as_str()))
} Type guard
fn is_valid_byday_rrule(rrule: &str) -> bool {
AutomationSchedule::parse_rrule(rrule).is_ok()
} Prevention
- Offer BYDAY as a weekday picker instead of free text
- Validate the rrule with parse_rrule at the tool boundary before create/update
- Normalize input to two-letter uppercase codes early
- Document that ordinals (1MO) and numeric codes are unsupported
When it happens
Trigger: AutomationSchedule::parse_rrule("FREQ=WEEKLY;BYDAY=MONDAY;BYHOUR=9;BYMINUTE=0") (full word); BYDAY=1 (numeric code); BYDAY=MO;TU (wrong separator); a stray token like BYDAY=MO,XX.
Common situations: Copying RRULE syntax from iCalendar examples that allow ordinals or full names; assuming ISO numeric weekday codes; simple typos in hand-written rules.
Related errors
- Unable to compute next HOURLY run for BYDAY filter
- Unsupported RRULE field '{key}' for ONCE. Allowed: FREQ,AT
- Unsupported RRULE field '{key}' for CRON. Allowed: FREQ,EXPR
- context_window must be greater than 0
- custom provider '{provider_id}' must set [providers.{provide
AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20).
Data as JSON: /api/errors/26d1205fe7dbdbfd.
Report an issue: GitHub.