{"record":{"id":"c8bb2027c31b03ab","repo":"Hmbown/CodeWhale","slug":"expected-a-notification-boolean","errorCode":null,"errorMessage":"expected a notification boolean","messagePattern":"expected a notification boolean","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/notifications.rs","lineNumber":194,"sourceCode":"    Sound(Option<CompletionSound>),\n    Condition(NotificationCondition),\n    CompletionSound(CompletionSound),\n    SubagentCompletion(SubagentCompletionNotification),\n    SoundFile(PathBuf),\n    Event(NotificationEvent, bool),\n    EventSoundEnabled(bool),\n    EventSoundEvents(Vec<String>),\n    EventSoundMinIntervalMs(u64),\n    EventSoundQuiet(bool),\n}\n\nimpl NotificationConfigUpdate {\n    pub fn parse(setting: NotificationSetting, raw: &str) -> Result<Self> {\n        use NotificationSetting as K;\n        let boolean = || match raw.trim().to_ascii_lowercase().as_str() {\n            \"true\" | \"on\" | \"yes\" | \"1\" => Ok(true),\n            \"false\" | \"off\" | \"no\" | \"0\" => Ok(false),\n            _ => bail!(\"expected a notification boolean\"),\n        };\n        let integer = || {\n            let value: u64 = raw\n                .trim()\n                .parse()\n                .context(\"expected a nonnegative notification integer\")?;\n            anyhow::ensure!(\n                value <= i64::MAX as u64,\n                \"notification integer exceeds TOML range\"\n            );\n            Ok(value)\n        };\n        Ok(match setting {\n            K::Method => {\n                Self::Method(NotificationMethod::parse(raw).context(\"invalid notification method\")?)\n            }\n            K::ThresholdSecs => Self::ThresholdSecs(integer()?),\n            K::IncludeSummary => Self::IncludeSummary(boolean()?),","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/config/src/notifications.rs#L176-L212","documentation":"NotificationConfigUpdate::parse converts a raw string value for a notification setting into a typed update. Boolean settings (e.g. include-summary, quiet flags, event sound toggles in the notifications namespace) are parsed by the `boolean` closure, which accepts true/on/yes/1 and false/off/no/0 (case-insensitive, trimmed). Anything else — such as \"enabled\", \"2\", or an empty string — fails with this error.","triggerScenarios":"Calling ConfigToml::set_value with a key in the notifications namespace whose setting is boolean-kind and a value like \"enabled\", \"sure\", \"2\", or \"\".","commonSituations":"Typing natural language into the config setter instead of a boolean token, scripts writing locale-specific truthy strings, or quoting errors in config.toml leaving an empty value.","solutions":["Use one of the accepted spellings: true, on, yes, 1 (or false, off, no, 0)","Check for stray quotes or embedded characters around the value in config.toml","Confirm the setting key you're writing is actually a boolean setting; integer settings need a nonnegative number"],"exampleFix":"// before\nset_value(\"notifications.include-summary\", \"enabled\")\n// after\nset_value(\"notifications.include-summary\", \"true\")","handlingStrategy":"validation","validationCode":"fn is_notification_boolean(raw: &str) -> bool {\n    matches!(raw.trim().to_ascii_lowercase().as_str(),\n        \"true\" | \"on\" | \"yes\" | \"1\" | \"false\" | \"off\" | \"no\" | \"0\")\n}","typeGuard":"fn parse_bool_token(raw: &str) -> Option<bool> {\n    match raw.trim().to_ascii_lowercase().as_str() {\n        \"true\" | \"on\" | \"yes\" | \"1\" => Some(true),\n        \"false\" | \"off\" | \"no\" | \"0\" => Some(false),\n        _ => None,\n    }\n}","tryCatchPattern":"match NotificationConfigUpdate::parse(setting, raw) {\n    Ok(update) => update,\n    Err(e) if e.to_string().contains(\"expected a notification boolean\") => {\n        eprintln!(\"'{}' is not a boolean; use true/on/yes/1 or false/off/no/0\", raw);\n        Default::default()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Map free-text toggles (\"enabled\") to boolean tokens in your UI before writing","Validate values with parse_bool_token before calling set_value","Remember integer settings need a number, not a boolean token"],"tags":["config","notifications","validation","boolean"],"backgroundTag":"invalid-config-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}