{"record":{"id":"e4cfa7649711bbef","repo":"Hmbown/CodeWhale","slug":"failed-to-resolve-settings-path-no-config-directo","errorCode":null,"errorMessage":"Failed to resolve settings path: no config directory found.","messagePattern":"Failed to resolve settings path: no config directory found\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/settings.rs","lineNumber":745,"sourceCode":"/// `/config preset` command so the bundle is never defined twice.\n#[must_use]\npub fn preset_fields(name: &str) -> Option<&'static [(&'static str, &'static str)]> {\n    match name.trim().to_ascii_lowercase().as_str() {\n        \"calm\" => Some(CALM_PRESET_FIELDS),\n        _ => None,\n    }\n}\n\nimpl Settings {\n    /// Get the canonical settings file path.\n    ///\n    /// New writes should target `~/.codewhale/settings.toml`. Legacy\n    /// DeepSeek-branded paths remain readable as fallbacks during load, but we\n    /// no longer surface them as the primary path in `/config`.\n    pub fn path() -> Result<PathBuf> {\n        let (primary, _legacy_home, legacy_config_dir) = settings_path_candidates();\n        primary.or(legacy_config_dir).ok_or_else(|| {\n            anyhow::anyhow!(\"Failed to resolve settings path: no config directory found.\")\n        })\n    }\n\n    /// Load settings from disk, or return defaults if not found\n    pub fn load() -> Result<Self> {\n        let mut settings = Self::load_persisted()?;\n        settings.apply_env_overrides();\n        Ok(settings)\n    }\n\n    /// Load settings for a diagnostic without migrating a legacy file.\n    ///\n    /// This preserves the same candidate precedence, parser normalization, and\n    /// environment overlays as [`Settings::load`]. Unlike an interactive\n    /// startup, diagnostics must not create `~/.codewhale/settings.toml` just\n    /// because they inspected a legacy `~/.deepseek/settings.toml` file.\n    pub(crate) fn load_read_only() -> Result<Self> {\n        let mut settings = Self::load_persisted_read_only()?;","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/settings.rs#L727-L763","documentation":"Raised while resolving the canonical Settings path: no config directory could be found for the platform, so ~/.codewhale/settings.toml (and legacy fallbacks) are unresolvable. It fires before any file read/write — the environment simply provides no home/config root.","triggerScenarios":"Thrown at crates/tui/src/settings.rs:745 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HOME or the platform config-directory env var to a valid path","Create the config directory manually and rerun","In sandboxed/test environments, use the config override env var to redirect settings I/O"],"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-14T00:17:10.932Z"}