{"record":{"id":"849f944a04d5580e","repo":"Hmbown/CodeWhale","slug":"model-defaults-belong-to-config-toml-use-model-and-choose","errorCode":null,"errorMessage":"Model defaults belong to config.toml. Use /model and choose Remember as my default, or /config model <id> --save.","messagePattern":"Model defaults belong to config\\.toml\\. Use /model and choose Remember as my default, or /config model <id> --save\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":1748,"sourceCode":"                let max: usize = value.parse().map_err(|_| {\n                    anyhow::anyhow!(\n                        \"Failed to update setting: invalid max history '{value}'. Expected a positive number.\"\n                    )\n                })?;\n                self.max_input_history = max;\n            }\n            \"default_model\" | \"model\" => {\n                anyhow::bail!(\n                    \"Model defaults belong to config.toml. Use /model and choose Remember as my default, or /config model <id> --save.\"\n                );\n            }\n            \"reasoning_effort\" | \"effort\" => {\n                self.reasoning_effort = normalize_reasoning_effort_setting(value)?;\n            }\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","sourceCodeStart":1730,"sourceCodeEnd":1766,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/settings.rs#L1730-L1766","documentation":"Settings::set deliberately refuses the `default_model`/`model` key: model defaults are owned by config.toml, not session settings. The bail message redirects the user to the /model picker ('Remember as my default') or `/config model <id> --save`. This is an unsupported-operation guard, not a value-format error.","triggerScenarios":"Any call to Settings::set(\"default_model\", ...) or Settings::set(\"model\", ...) with any value — the key itself is rejected unconditionally.","commonSituations":"Users attempting `/config model <id>` without --save, scripts migrating settings files that used to carry default_model, or confusing the settings layer with the config layer.","solutions":["Use the /model command in the TUI and pick 'Remember as my default'.","Write the model id into config.toml via `/config model <id> --save`.","Remove default_model from any settings write path; it is not a settable session setting."],"exampleFix":"// before\nsettings.set(\"default_model\", \"glm-5.3-flash\")?;\n// after\n// in the TUI:\n//   /config model glm-5.3-flash --save\n// or edit ~/.config/codewhale/config.toml: model = \"glm-5.3-flash\"","handlingStrategy":"fallback","validationCode":"fn is_model_setting_key(key: &str) -> bool {\n    matches!(key, \"default_model\" | \"model\") // always rejected by Settings::set\n}","typeGuard":null,"tryCatchPattern":"match settings.set(key, value) {\n    Err(e) if e.to_string().contains(\"Model defaults belong to config.toml\") => {\n        // route to the model config path instead of settings\n        write_model_to_config_toml(value)?;\n    }\n    r => r?,\n}","preventionTips":["Never route model defaults through Settings::set; use /config model <id> --save or config.toml.","Filter model-related keys out of generic settings-write helpers.","Update migration scripts that predate this separation."],"tags":["rust","configuration","unsupported"],"backgroundTag":"unsupported-operation","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"}