{"record":{"id":"664e6eef28a81a33","repo":"Hmbown/CodeWhale","slug":"failed-to-resolve-tui-preferences-path-no-home-di","errorCode":null,"errorMessage":"Failed to resolve tui preferences path: no home directory found.","messagePattern":"Failed to resolve tui preferences path: no home directory found\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":275,"sourceCode":"\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    }\n\n    if let Some(path) = legacy_home.as_ref()\n        && path.exists()\n    {\n        return Ok(path.clone());\n    }\n\n    primary.or(legacy_home).ok_or_else(|| {\n        anyhow::anyhow!(\"Failed to resolve tui preferences path: no home directory found.\")\n    })\n}\n\n/// User settings with defaults\n#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]\npub struct PinnedModel {\n    /// Exact configured provider identity; labels never replace this value.\n    pub provider: String,\n    /// Exact provider-owned model id.\n    pub model: String,\n    /// Optional presentation-only label.\n    #[serde(default, skip_serializing_if = \"Option::is_none\")]\n    pub label: Option<String>,\n}\n\n#[derive(Debug, Clone, Serialize, Deserialize)]\n#[serde(default)]\npub struct Settings {","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/settings.rs#L257-L293","documentation":"Terminal failure inside resolve_tui_prefs_path_from_candidates: neither the primary nor the legacy-home candidate path exists, and at least one candidate Option was present but neither matched, leaving primary.or(legacy_home) empty only when both are None — i.e. no usable home directory exists to read or write tui.toml from.","triggerScenarios":"Thrown at crates/tui/src/settings.rs:275 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HOME/XDG home so a config directory exists","Create the Codewhale home directory so the primary candidate becomes usable","Point tests at a temp dir via the environment override instead of relying on a real home"],"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"}