{"record":{"id":"df01dc536ba6f938","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-invalid-synchronized-out","errorCode":null,"errorMessage":"Failed to update setting: invalid synchronized_output '{value}'. Expected: auto, on, off.","messagePattern":"Failed to update setting: invalid synchronized_output '(.+?)'\\. Expected: auto, on, off\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1687,"sourceCode":"                    anyhow::bail!(\n                        \"Failed to update setting: invalid transcript spacing '{value}'. Expected: compact, comfortable, spacious.\"\n                    );\n                }\n                self.transcript_spacing = normalized.to_string();\n            }\n            \"status_indicator\" | \"indicator\" => {\n                let normalized = normalize_status_indicator(value);\n                if ![\"cw\", \"whale\", \"dots\", \"off\"].contains(&normalized) {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid status indicator '{value}'. Expected: cw, whale, dots, off.\"\n                    );\n                }\n                self.status_indicator = normalized.to_string();\n            }\n            \"synchronized_output\" | \"sync_output\" | \"sync\" => {\n                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                    ),","sourceCodeStart":1669,"sourceCodeEnd":1705,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L1669-L1705","documentation":"Settings::set validates the `synchronized_output` (aliases sync_output, sync) value via normalize_synchronized_output and rejects anything outside [\"auto\", \"on\", \"off\"]. This setting controls synchronized terminal rendering; an invalid value would break the tri-state handling downstream, so the setter refuses it up front.","triggerScenarios":"Settings::set(\"synchronized_output\", v) / set(\"sync\", v) where v normalizes outside auto|on|off — e.g. `sync true`, `sync yes`, or `sync Auto` if the normalizer is case-sensitive.","commonSituations":"Users typing boolean words (true/false/yes/no) instead of the tri-state keywords, or scripting /config commands in dotfiles with wrong casing.","solutions":["Use exactly auto, on, or off.","Prefer `auto` unless debugging rendering artifacts (terminal tearing).","Check normalize_synchronized_output for accepted casing and whitespace."],"exampleFix":"// before\nsettings.set(\"synchronized_output\", \"true\")?;\n// after\nsettings.set(\"synchronized_output\", \"on\")?;","handlingStrategy":"validation","validationCode":"fn valid_sync_output(v: &str) -> bool {\n    matches!(v.trim().to_ascii_lowercase().as_str(), \"auto\" | \"on\" | \"off\")\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = settings.set(\"synchronized_output\", value) {\n    if e.to_string().contains(\"invalid synchronized_output\") { value = \"auto\".into(); settings.set(\"synchronized_output\", &value)?; }\n    else { return Err(e); }\n}","preventionTips":["Map user booleans (true/false) to the tri-state (on/off) before calling set.","Default to \"auto\" in scripts.","Test /config lines in a scratch session before adding to dotfiles."],"tags":["rust","configuration","validation"],"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"}