Hmbown/CodeWhale · error

Failed to resolve settings path: no config directory found.

Error message

Failed to resolve settings path: no config directory found.

What it means

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.

Source

Thrown at crates/tui/src/settings.rs:745

/// `/config preset` command so the bundle is never defined twice.
#[must_use]
pub fn preset_fields(name: &str) -> Option<&'static [(&'static str, &'static str)]> {
    match name.trim().to_ascii_lowercase().as_str() {
        "calm" => Some(CALM_PRESET_FIELDS),
        _ => None,
    }
}

impl Settings {
    /// Get the canonical settings file path.
    ///
    /// New writes should target `~/.codewhale/settings.toml`. Legacy
    /// DeepSeek-branded paths remain readable as fallbacks during load, but we
    /// no longer surface them as the primary path in `/config`.
    pub fn path() -> Result<PathBuf> {
        let (primary, _legacy_home, legacy_config_dir) = settings_path_candidates();
        primary.or(legacy_config_dir).ok_or_else(|| {
            anyhow::anyhow!("Failed to resolve settings path: no config directory found.")
        })
    }

    /// Load settings from disk, or return defaults if not found
    pub fn load() -> Result<Self> {
        let mut settings = Self::load_persisted()?;
        settings.apply_env_overrides();
        Ok(settings)
    }

    /// Load settings for a diagnostic without migrating a legacy file.
    ///
    /// This preserves the same candidate precedence, parser normalization, and
    /// environment overlays as [`Settings::load`]. Unlike an interactive
    /// startup, diagnostics must not create `~/.codewhale/settings.toml` just
    /// because they inspected a legacy `~/.deepseek/settings.toml` file.
    pub(crate) fn load_read_only() -> Result<Self> {
        let mut settings = Self::load_persisted_read_only()?;

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Set HOME or the platform config-directory env var to a valid path
  2. Create the config directory manually and rerun
  3. In sandboxed/test environments, use the config override env var to redirect settings I/O
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/tui/src/settings.rs:745 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/e4cfa7649711bbef. Report an issue: GitHub.