{"record":{"id":"79d478cc816a0de8","repo":"zeroclaw-labs/zeroclaw","slug":"unsupported-delay-unit-unit-use-s-m-h-d","errorCode":null,"errorMessage":"unsupported delay unit '{unit}', use s/m/h/d","messagePattern":"unsupported delay unit '(.+?)', use s/m/h/d","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/cron/mod.rs","lineNumber":433,"sourceCode":"}\n\npub fn parse_delay(input: &str) -> Result<chrono::Duration> {\n    let input = input.trim();\n    if input.is_empty() {\n        anyhow::bail!(\"delay must not be empty\");\n    }\n    let split = input\n        .find(|c: char| !c.is_ascii_digit())\n        .unwrap_or(input.len());\n    let (num, unit) = input.split_at(split);\n    let amount: i64 = num.parse()?;\n    let unit = if unit.is_empty() { \"m\" } else { unit };\n    let duration = match unit {\n        \"s\" => chrono::Duration::seconds(amount),\n        \"m\" => chrono::Duration::minutes(amount),\n        \"h\" => chrono::Duration::hours(amount),\n        \"d\" => chrono::Duration::days(amount),\n        _ => anyhow::bail!(\"unsupported delay unit '{unit}', use s/m/h/d\"),\n    };\n    Ok(duration)\n}\n\n#[cfg(test)]\nmod security_validation_tests {\n    use super::*;\n    use tempfile::TempDir;\n\n    fn test_config(tmp: &TempDir) -> Config {\n        let config = Config {\n            data_dir: tmp.path().join(\"data\"),\n            config_path: tmp.path().join(\"config.toml\"),\n            ..Config::default()\n        };\n        std::fs::create_dir_all(&config.data_dir).unwrap();\n        config\n    }","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/cron/mod.rs#L415-L451","documentation":"Validation guard in parse_delay: the unit suffix following the number is not one of s, m, h, or d. An omitted unit defaults to minutes, but an unrecognized suffix (for example '30w') reaches this match fallback and the delay string is rejected.","triggerScenarios":"Thrown at crates/zeroclaw-runtime/src/cron/mod.rs:433 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported delay unit: s (seconds), m (minutes), h (hours), or d (days)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","contentChangedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}