{"record":{"id":"afbde4dc97ce2f8b","repo":"Hmbown/CodeWhale","slug":"failed-to-update-setting-unknown-setting-key","errorCode":null,"errorMessage":"Failed to update setting: unknown setting '{key}'.","messagePattern":"Failed to update setting: unknown setting '(.+?)'\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1762,"sourceCode":"            }\n            \"permission_posture\" | \"permissions\" => {\n                self.permission_posture = normalize_permission_posture(value);\n                if self.permission_posture.is_none() {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid permission posture '{value}'. Expected: ask, auto-review, or full-access.\"\n                    );\n                }\n            }\n            \"sandbox_mode\" | \"sandbox\" | \"filesystem_sandbox\" => {\n                self.sandbox_mode = normalize_sandbox_mode(value);\n                if self.sandbox_mode.is_none() {\n                    anyhow::bail!(\n                        \"Failed to update setting: invalid sandbox_mode '{value}'. Expected: read-only, workspace-write, danger-full-access, or external-sandbox.\"\n                    );\n                }\n            }\n            _ => {\n                anyhow::bail!(\"Failed to update setting: unknown setting '{key}'.\");\n            }\n        }\n        if let Some(canonical) = canonical {\n            self.provenance\n                .insert(canonical.to_string(), Layer::SessionOverride);\n        }\n        Ok(())\n    }\n\n    /// Apply a named settings preset (#3478).\n    ///\n    /// Presets are the first bundled-settings mechanism: a single name applies a\n    /// coherent group of presentation knobs. `calm` is the \"beautiful/calm\n    /// transcript\" preset — it quiets motion and verbose tool output while\n    /// **keeping evidence reachable**: thinking stays visible and tool runs stay\n    /// expandable (only their inline detail is collapsed), so maintainer/release\n    /// work is never blind to failures. Presentation only — no model, provider,\n    /// routing, or safety setting is touched. Reuses [`Settings::set`] so each","sourceCodeStart":1744,"sourceCodeEnd":1780,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L1744-L1780","documentation":"The catch-all arm of Settings::set's key match: any setting key that is not one of the handled names (or their aliases) bails with this error. The setter is the single validation funnel for /config writes and presets (apply_preset reuses it), so this also surfaces for typos inside a preset bundle.","triggerScenarios":"Settings::set(key, _) with an unknown key — e.g. `/config color_theme dark` (not a settings key), misspellings like `maxhistory` or `synced_output`, or keys that belong to config.toml rather than session settings.","commonSituations":"Guessing setting names from memory, porting keys from other tools (theme, font_size), or applying a preset whose bundle references a renamed key after a refactor.","solutions":["Run the settings display (e.g. /config with no args) to list valid keys.","Check the match arms in Settings::set (crates/tui/src/settings.rs) for the exact key and its aliases.","Keys like default_model are intentionally rejected — see their specific redirect errors."],"exampleFix":"// before\nsettings.set(\"themes\", \"dark\")?;\n// after\nsettings.set(\"status_indicator\", \"cw\")?; // pick a real settings key","handlingStrategy":"validation","validationCode":"const SETTING_KEYS: [&str; 20] = [\"status_indicator\", \"indicator\", \"synchronized_output\", \"sync_output\", \"sync\", \"default_mode\", \"mode\", \"cost_currency\", \"currency\", \"max_history\", \"history\", \"reasoning_effort\", \"effort\", \"permission_posture\", \"permissions\", \"sandbox_mode\", \"sandbox\", \"transcript_spacing\", \"spacing\", \"context_panel\"];\nfn is_known_setting(key: &str) -> bool {\n    SETTING_KEYS.contains(&key)\n}","typeGuard":null,"tryCatchPattern":"match settings.set(key, value) {\n    Err(e) if e.to_string().contains(\"unknown setting\") => eprintln!(\"run /config to list valid settings\"),\n    r => r?,\n}","preventionTips":["Maintain a key allowlist in wrapper scripts mirroring the setter's match arms.","Prefer the settings display output over guessing key names.","Grep settings.rs match arms when adding new keys to scripts."],"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"}