{"record":{"id":"cb1a7475f2895d93","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-invalid-mention-menu-beh","errorCode":null,"errorMessage":"Failed to update setting: invalid mention_menu_behavior '{value}'. Expected: fuzzy, browser.","messagePattern":"Failed to update setting: invalid mention_menu_behavior '(.+?)'\\. Expected: fuzzy, browser\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":2611,"sourceCode":"    let percent = trimmed.parse::<f64>().map_err(|_| {\n        anyhow::anyhow!(\n            \"Failed to update setting: invalid {key} '{value}'. Expected a number from 10 to 100.\"\n        )\n    })?;\n    if !(10.0..=100.0).contains(&percent) {\n        anyhow::bail!(\n            \"Failed to update setting: invalid {key} '{value}'. Expected a number from 10 to 100.\"\n        );\n    }\n    Ok(percent)\n}\n\nfn normalize_mention_menu_behavior(value: &str) -> Result<String> {\n    match value.trim().to_ascii_lowercase().as_str() {\n        \"fuzzy\" | \"default\" => Ok(\"fuzzy\".to_string()),\n        \"browser\" | \"browse\" | \"file-browser\" | \"file_browser\" => Ok(\"browser\".to_string()),\n        _ => {\n            anyhow::bail!(\n                \"Failed to update setting: invalid mention_menu_behavior '{value}'. Expected: fuzzy, browser.\"\n            )\n        }\n    }\n}\n\nfn normalize_mode(value: &str) -> &str {\n    match value.trim().to_ascii_lowercase().as_str() {\n        \"edit\" => \"agent\",\n        \"normal\" => \"agent\",\n        \"agent\" | \"act\" | \"work\" => \"agent\",\n        \"plan\" => \"plan\",\n        // Operate is a first-class startup mode (Hunter 2026-07-24).\n        \"operate\" | \"operation\" | \"ops\" => \"operate\",\n        // yolo was mode+permission; keep mode as Act and migrate posture on load.\n        \"yolo\" => \"agent\",\n        _ => value,\n    }","sourceCodeStart":2593,"sourceCodeEnd":2629,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/settings.rs#L2593-L2629","documentation":"Thrown by normalize_mention_menu_behavior when the mention_menu_behavior setting receives a value outside its alias table. 'fuzzy'/'default' normalize to fuzzy; 'browser'/'browse'/'file-browser'/'file_browser' normalize to browser. Everything else bails, naming the two canonical values.","triggerScenarios":"':set mention_menu_behavior popup', ':set mention_menu_behavior files', or a misspelling like 'browesr'. Note that 'file browser' with a space is rejected; only the hyphen/underscore alias forms are accepted.","commonSituations":"Users guessing the value from the feature rather than the enum, hyphen/space/underscore drift between docs and parser, and dotfiles copied from other tools whose mode names differ.","solutions":["Set the value to the canonical 'fuzzy' or 'browser'.","If you typed an alias, use one of browse, file-browser, file_browser, or default.","Check for typos; the match is exact after lowercase and trim.","Update stale dotfiles that carry an invented or outdated value name."],"exampleFix":"# before\n:set mention_menu_behavior file browser\n\n# after\n:set mention_menu_behavior file-browser","handlingStrategy":"validation","validationCode":"fn valid_mention_behavior(v: &str) -> bool {\n    matches!(\n        v.trim().to_ascii_lowercase().as_str(),\n        \"fuzzy\" | \"default\" | \"browser\" | \"browse\" | \"file-browser\" | \"file_browser\"\n    )\n}","typeGuard":"enum MentionBehavior { Fuzzy, Browser }\n\nimpl MentionBehavior {\n    fn parse(v: &str) -> Option<Self> {\n        match v.trim().to_ascii_lowercase().as_str() {\n            \"fuzzy\" | \"default\" => Some(Self::Fuzzy),\n            \"browser\" | \"browse\" | \"file-browser\" | \"file_browser\" => Some(Self::Browser),\n            _ => None,\n        }\n    }\n}","tryCatchPattern":null,"preventionTips":["Offer the two canonical values as completion choices for the set command.","Normalize aliases to canonical values in wrapper config before saving.","Reject spaces in the value; only hyphen/underscore aliases are valid."],"tags":["settings","enum","mention-menu","validation","tui","rust"],"backgroundTag":"invalid-enum-config-value","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}