{"record":{"id":"53fd392cb44888dd","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-err","errorCode":null,"errorMessage":"Failed to update setting: {err}","messagePattern":"Failed to update setting: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":2791,"sourceCode":"        }\n        _ => None,\n    }\n}\n\nfn normalize_reasoning_effort_setting(value: &str) -> Result<Option<String>> {\n    let trimmed = value.trim();\n    if trimmed.is_empty()\n        || matches!(\n            trimmed.to_ascii_lowercase().as_str(),\n            \"default\" | \"(default)\" | \"config\" | \"configured\" | \"unset\"\n        )\n    {\n        return Ok(None);\n    }\n\n    ReasoningEffort::parse_strict(trimmed)\n        .map(|effort| Some(effort.as_setting().to_string()))\n        .map_err(|err| anyhow::anyhow!(\"Failed to update setting: {err}\"))\n}\n\n/// Parse a boolean value from various formats\nfn parse_bool(value: &str) -> Result<bool> {\n    match value.to_lowercase().as_str() {\n        \"on\" | \"true\" | \"yes\" | \"1\" | \"enabled\" => Ok(true),\n        \"off\" | \"false\" | \"no\" | \"0\" | \"disabled\" => Ok(false),\n        _ => {\n            anyhow::bail!(\"Failed to parse boolean '{value}': expected on/off, true/false, yes/no.\")\n        }\n    }\n}\n\nfn default_thinking_preview_lines() -> usize {\n    2\n}\n\nfn default_true() -> bool {","sourceCodeStart":2773,"sourceCodeEnd":2809,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L2773-L2809","documentation":"Thrown when a user-supplied reasoning-effort string fails ReasoningEffort::parse_strict while updating the setting via the settings update path. The inner parse error is wrapped with a uniform 'Failed to update setting' prefix.","triggerScenarios":"Passing a value that is not a strictly valid reasoning-effort keyword (after trimming) to the setting-update command for reasoning effort.","commonSituations":"Typo like 'hig' or 'maximum'; capitalization/spacing variants not accepted by the strict parser; scripting the setting update with a wrong value.","solutions":["Use one of the exact accepted reasoning-effort keywords (e.g. off/minimal/low/medium/high as defined by ReasoningEffort::parse_strict)","Check the setting name and value spelling","Run the update command interactively to see the accepted values"],"exampleFix":"// before\n/settings reasoning-effort maximum\n// after\n/settings reasoning-effort high","handlingStrategy":"validation","validationCode":"const EFFORTS: [&str; 5] = [\"off\", \"minimal\", \"low\", \"medium\", \"high\"];\nfn is_valid_effort(v: &str) -> bool { EFFORTS.contains(&v.trim().to_lowercase().as_str()) }","typeGuard":null,"tryCatchPattern":"match update_reasoning_effort(input) {\n    Ok(v) => /* apply */,\n    Err(e) => eprintln!(\"{e:#}; accepted values: off, minimal, low, medium, high\"),\n}","preventionTips":["Validate effort keywords against the enum before calling the setter","Keep a completion list of valid values in any CLI/script wrapper","Avoid free-form synonyms like 'max' or 'maximum'"],"tags":["config","validation","parsing"],"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"}