{"record":{"id":"cc7b7ff5b2b71d22","repo":"Hmbown/CodeWhale","slug":"tui-toml-is-malformed-using-defaults-e","errorCode":null,"errorMessage":"⚠ tui.toml is malformed — using defaults ({e})","messagePattern":"⚠ tui\\.toml is malformed — using defaults \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/tui/app/init.rs","lineNumber":139,"sourceCode":"        // to defaults), surface a warning in the TUI so the user knows their\n        // file is broken instead of silently losing all settings.\n        let settings_parse_warning = crate::settings::Settings::path().ok().and_then(|p| {\n            if p.exists() {\n                std::fs::read_to_string(&p).ok().and_then(|raw| {\n                    ::toml::from_str::<::toml::Value>(&raw)\n                        .err()\n                        .map(|e| format!(\"⚠ settings.toml is malformed — using defaults ({e})\"))\n                })\n            } else {\n                None\n            }\n        });\n        let tui_prefs_warning = crate::settings::TuiPrefs::path().ok().and_then(|p| {\n            if p.exists() {\n                std::fs::read_to_string(&p).ok().and_then(|raw| {\n                    ::toml::from_str::<::toml::Value>(&raw)\n                        .err()\n                        .map(|e| format!(\"⚠ tui.toml is malformed — using defaults ({e})\"))\n                })\n            } else {\n                None\n            }\n        });\n\n        let mut provider = config.api_provider();\n\n        // A startup route saved explicitly from `/model` is a user choice and\n        // must win over a provider merely seeded in config.toml. A one-launch\n        // CLI/environment provider override still wins so scripts can pin\n        // their route without changing the user's next interactive launch.\n        let explicit_launch_provider = crate::config::explicit_launch_provider_override().is_some();\n        let mut provider_identity_record = config\n            .active_provider_identity(provider)\n            .unwrap_or_else(|_| {\n                let key = config.provider_identity_for(provider);\n                let exact_id = (!(provider == ApiProvider::Custom","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tui/app/init.rs#L121-L157","documentation":"Same startup fallback as settings.toml but for tui.toml: the file exists yet failed TOML parsing, so TUI-specific configuration is discarded for this session and a ⚠ warning is shown. Launch proceeds with defaults; the corrupt file is not modified or deleted automatically.","triggerScenarios":"Thrown at crates/tui/src/tui/app/init.rs:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repair the TOML syntax named in the warning message","Remove or rename the file to start from defaults, then re-add settings incrementally","Check for schema changes if the file worked under an older version"],"exampleFix":null,"handlingStrategy":"fallback","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"}