{"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":2852,"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":2834,"sourceCodeEnd":2870,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L2834-L2870","documentation":"normalize_mention_menu_behavior maps user input to one of two canonical values: 'fuzzy' (aliases: default) or 'browser' (aliases: browse, file-browser, file_browser), case-insensitively. Anything else bails with this error listing the accepted values. It validates the mention_menu_behavior setting.","triggerScenarios":"`/setting mention_menu_behavior autocomplete` or any value outside the alias list — including empty strings and misspellings like \"fuzze\".","commonSituations":"Guessing a third mode that doesn't exist; older config values from a version with more options; typos when hand-editing settings.toml.","solutions":["Use 'fuzzy' or 'browser' (or their aliases: default, browse, file-browser, file_browser)","Check the current value with the settings display and correct it","If migrating from an older version, remap removed modes to fuzzy or browser"],"exampleFix":"// before\nset mention_menu_behavior autocomplete\n// after\nset mention_menu_behavior fuzzy","handlingStrategy":"validation","validationCode":"const VALID_MENTION_MODES: [&str; 6] = [\"fuzzy\",\"default\",\"browser\",\"browse\",\"file-browser\",\"file_browser\"];\nfn valid_mention_mode(v: &str) -> bool {\n    VALID_MENTION_MODES.contains(&v.trim().to_ascii_lowercase().as_str())\n}","typeGuard":null,"tryCatchPattern":"match normalize_mention_menu_behavior(raw) {\n    Ok(mode) => /* store mode */,\n    Err(e) if e.to_string().contains(\"mention_menu_behavior\") => {\n        eprintln!(\"{e}\"); // offer a fuzzy/browser picker\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Present a two-option picker (fuzzy/browser) instead of free text","Migrate removed/renamed modes to fuzzy or browser on upgrade","Lowercase and trim user input before validating"],"tags":["settings","validation","enum"],"backgroundTag":"invalid-enum-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"}