Hmbown/CodeWhale · error
expected a notification boolean
Error message
expected a notification boolean
What it means
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.
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
Example fix
// before
set_value("notifications.include-summary", "enabled")
// after
set_value("notifications.include-summary", "true") Defensive patterns
Strategy: validation
Validate before calling
fn is_notification_boolean(raw: &str) -> bool {
matches!(raw.trim().to_ascii_lowercase().as_str(),
"true" | "on" | "yes" | "1" | "false" | "off" | "no" | "0")
} Type guard
fn parse_bool_token(raw: &str) -> Option<bool> {
match raw.trim().to_ascii_lowercase().as_str() {
"true" | "on" | "yes" | "1" => Some(true),
"false" | "off" | "no" | "0" => Some(false),
_ => None,
}
} Try / catch
match NotificationConfigUpdate::parse(setting, raw) {
Ok(update) => update,
Err(e) if e.to_string().contains("expected a notification boolean") => {
eprintln!("'{}' is not a boolean; use true/on/yes/1 or false/off/no/0", raw);
Default::default()
}
Err(e) => return Err(e),
} Prevention
- 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
When it happens
Trigger: Calling ConfigToml::set_value with a key in the notifications namespace whose setting is boolean-kind and a value like "enabled", "sure", "2", or "".
Common situations: 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.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Can't use ' ' for . Try: .
- ConfigCommandInvalidValue
- agent profile provider cannot be empty
- agent profile provider must be a simple provider id
- api_key cannot be empty string
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/c8bb2027c31b03ab.
Report an issue: GitHub.
Appendix: source
Thrown at crates/config/src/notifications.rs:194
Sound(Option<CompletionSound>),
Condition(NotificationCondition),
CompletionSound(CompletionSound),
SubagentCompletion(SubagentCompletionNotification),
SoundFile(PathBuf),
Event(NotificationEvent, bool),
EventSoundEnabled(bool),
EventSoundEvents(Vec<String>),
EventSoundMinIntervalMs(u64),
EventSoundQuiet(bool),
}
impl NotificationConfigUpdate {
pub fn parse(setting: NotificationSetting, raw: &str) -> Result<Self> {
use NotificationSetting as K;
let boolean = || match raw.trim().to_ascii_lowercase().as_str() {
"true" | "on" | "yes" | "1" => Ok(true),
"false" | "off" | "no" | "0" => Ok(false),
_ => bail!("expected a notification boolean"),
};
let integer = || {
let value: u64 = raw
.trim()
.parse()
.context("expected a nonnegative notification integer")?;
anyhow::ensure!(
value <= i64::MAX as u64,
"notification integer exceeds TOML range"
);
Ok(value)
};
Ok(match setting {
K::Method => {
Self::Method(NotificationMethod::parse(raw).context("invalid notification method")?)
}
K::ThresholdSecs => Self::ThresholdSecs(integer()?),
K::IncludeSummary => Self::IncludeSummary(boolean()?),View on GitHub (pinned to 73e0f67d83)