{"record":{"id":"c09d9a554f71397f","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-invalid-mode-value","errorCode":null,"errorMessage":"Failed to update setting: invalid mode '{value}'. Expected: act (agent), plan, or operate.","messagePattern":"Failed to update setting: invalid mode '(.+?)'\\. Expected: act \\(agent\\), plan, or operate\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1422,"sourceCode":"                let normalized = normalize_synchronized_output(value);\n                if ![\"auto\", \"on\", \"off\"].contains(&normalized) {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid synchronized_output '{value}'. Expected: auto, on, off.\"\n                    );\n                }\n                self.synchronized_output = normalized.to_string();\n            }\n            \"workspace_follow_symlinks\" | \"follow_symlinks\" => {\n                self.workspace_follow_symlinks = parse_bool(value)?;\n            }\n            \"default_mode\" | \"mode\" => {\n                // Act (wire: agent), Plan, and Operate are valid startup modes.\n                // yolo remains a permission-migration alias, not a mode write.\n                self.default_mode = match value.trim().to_ascii_lowercase().as_str() {\n                    \"agent\" | \"normal\" | \"act\" | \"work\" | \"edit\" => \"agent\".to_string(),\n                    \"plan\" => \"plan\".to_string(),\n                    \"operate\" | \"operation\" | \"ops\" => \"operate\".to_string(),\n                    _ => anyhow::bail!(\n                        \"Failed to update setting: invalid mode '{value}'. Expected: act (agent), plan, or operate.\"\n                    ),\n                };\n            }\n            \"context_panel\" | \"context\" | \"session_panel\" => {\n                self.context_panel = parse_bool(value)?;\n            }\n            \"sessions_rail\" | \"sessions_panel\" | \"session_rail\" => {\n                self.sessions_rail = parse_bool(value)?;\n            }\n            \"session_auto_resume\" | \"auto_resume\" => {\n                self.session_auto_resume = parse_bool(value)?;\n            }\n            \"cost_currency\" | \"currency\" => {\n                let Some(currency) = crate::pricing::CostCurrency::from_setting(value) else {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid cost currency '{value}'. Expected: usd, cny, rmb, yuan.\"\n                    );","sourceCodeStart":1404,"sourceCodeEnd":1440,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/settings.rs#L1404-L1440","documentation":"Settings update validation for the default-mode key: the value (with aliases like agent→act, ops→operate normalized) still matched no supported mode. Modes map to the engine's authority posture, so an unknown mode cannot be stored.","triggerScenarios":"Thrown at crates/tui/src/settings.rs:1422 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the mode to act, plan, or operate"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}