{"record":{"id":"3b8f76559436d2a1","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-invalid-tool-collapse-mo","errorCode":null,"errorMessage":"Failed to update setting: invalid tool collapse mode '{value}'. Expected: compact, expanded, or calm.","messagePattern":"Failed to update setting: invalid tool collapse mode '(.+?)'\\. Expected: compact, expanded, or calm\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1230,"sourceCode":"    pub fn set(&mut self, key: &str, value: &str) -> Result<()> {\n        match key {\n            \"auto_compact\" | \"compact\" => {\n                self.auto_compact = parse_bool(value)?;\n                self.auto_compact_explicit = true;\n            }\n            \"auto_compact_threshold\" | \"auto_compact_threshold_percent\" => {\n                self.auto_compact_threshold_percent =\n                    parse_percent_setting(\"auto_compact_threshold_percent\", value)?;\n                self.auto_compact = true;\n                self.auto_compact_explicit = true;\n            }\n            \"calm_mode\" | \"calm\" => {\n                self.calm_mode = parse_bool(value)?;\n            }\n            \"tool_collapse\" | \"tool_collapse_mode\" | \"collapse\" => {\n                let normalized = normalize_tool_collapse_mode(value);\n                if !matches!(normalized, \"compact\" | \"expanded\" | \"calm\") {\n                    return Err(anyhow::anyhow!(\n                        \"Failed to update setting: invalid tool collapse mode '{value}'. Expected: compact, expanded, or calm.\"\n                    ));\n                }\n                self.tool_collapse_mode = normalized.to_string();\n            }\n            \"low_motion\" | \"motion\" => {\n                self.low_motion = parse_bool(value)?;\n            }\n            \"fancy_animations\" | \"fancy\" | \"animations\" => {\n                self.fancy_animations = parse_bool(value)?;\n            }\n            \"ocean_treatment\" | \"treatment\" | \"background_treatment\" => {\n                let normalized = value.trim().to_ascii_lowercase();\n                if !matches!(normalized.as_str(), \"ombre\" | \"flat\") {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid ocean treatment '{value}'. Expected: ombre or flat.\"\n                    );\n                }","sourceCodeStart":1212,"sourceCodeEnd":1248,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/settings.rs#L1212-L1248","documentation":"Validation branch in Settings::set for the tool collapse mode keys: the supplied value did not parse as one of the accepted modes (compact, expanded, calm). It is a user-input error from /config-style setting updates, not a system failure — the setting is left unchanged.","triggerScenarios":"Thrown at crates/tui/src/settings.rs:1230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the accepted values: compact, expanded, or calm","Check for typos, quoting artifacts, or trailing whitespace in the value","Run the config listing to see the current valid value before updating"],"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-14T05:17:10.506Z"}