{"record":{"id":"bdda0079824102a8","repo":"Hmbown/CodeWhale","slug":"failed-to-resolve-tui-toml-path-no-codewhale-home","errorCode":null,"errorMessage":"Failed to resolve tui.toml path: no Codewhale home found.","messagePattern":"Failed to resolve tui\\.toml path: no Codewhale home found\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":248,"sourceCode":"    pub fn validate(&mut self) -> Result<()> {\n        self.theme = normalize_theme_setting(&self.theme).map_err(anyhow::Error::msg)?;\n        Ok(())\n    }\n}\n\nfn tui_prefs_path_from_environment() -> Result<PathBuf> {\n    // Honour the same env-var escape hatch used by Settings::path so that\n    // integration tests can redirect all config I/O to a temp directory.\n    if let Some(parent) = config_override_parent() {\n        return Ok(parent.join(\"tui.toml\"));\n    }\n\n    let primary = codewhale_config::codewhale_home()\n        .ok()\n        .map(|home| home.join(TUI_PREFS_FILE_NAME));\n    if codewhale_config::codewhale_home_is_explicit() {\n        return primary.ok_or_else(|| {\n            anyhow::anyhow!(\"Failed to resolve tui.toml path: no Codewhale home found.\")\n        });\n    }\n    let legacy_home = codewhale_config::legacy_deepseek_home()\n        .ok()\n        .map(|home| home.join(TUI_PREFS_FILE_NAME));\n\n    resolve_tui_prefs_path_from_candidates(primary, legacy_home)\n}\n\nfn resolve_tui_prefs_path_from_candidates(\n    primary: Option<PathBuf>,\n    legacy_home: Option<PathBuf>,\n) -> Result<PathBuf> {\n    if let Some(path) = primary.as_ref()\n        && path.exists()\n    {\n        return Ok(path.clone());\n    }","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/settings.rs#L230-L266","documentation":"Raised in tui_prefs_path_from_environment: neither the config_override_parent escape hatch nor codewhale_config::codewhale_home() yielded a home directory, so there is nowhere to place tui.toml. The companion resolve_tui_prefs_path_from_candidates falls back to legacy candidates; this error is the terminal case where primary and legacy homes are both absent.","triggerScenarios":"Thrown at crates/tui/src/settings.rs:248 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HOME (or the platform equivalent) so codewhale_home() resolves","Use the env-var override the function honours (config_override_parent) to redirect config I/O to a writable directory","Create the expected home directory with correct permissions"],"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"}