Hmbown/CodeWhale · error · anyhow::Error

Failed to update setting: {err}

Error message

Failed to update setting: {err}

What it means

Wrapper produced by normalize_reasoning_effort_setting when ReasoningEffort::parse_strict rejects the trimmed value: after the sentinel words (default/config/unset) are excluded, the remaining string is not a recognized effort level. The {err} carries the parser's specific complaint; the setting update aborts with no change.

Source

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

        }
        _ => None,
    }
}

fn normalize_reasoning_effort_setting(value: &str) -> Result<Option<String>> {
    let trimmed = value.trim();
    if trimmed.is_empty()
        || matches!(
            trimmed.to_ascii_lowercase().as_str(),
            "default" | "(default)" | "config" | "configured" | "unset"
        )
    {
        return Ok(None);
    }

    ReasoningEffort::parse_strict(trimmed)
        .map(|effort| Some(effort.as_setting().to_string()))
        .map_err(|err| anyhow::anyhow!("Failed to update setting: {err}"))
}

/// Parse a boolean value from various formats
fn parse_bool(value: &str) -> Result<bool> {
    match value.to_lowercase().as_str() {
        "on" | "true" | "yes" | "1" | "enabled" => Ok(true),
        "off" | "false" | "no" | "0" | "disabled" => Ok(false),
        _ => {
            anyhow::bail!("Failed to parse boolean '{value}': expected on/off, true/false, yes/no.")
        }
    }
}

fn default_thinking_preview_lines() -> usize {
    2
}

fn default_true() -> bool {

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Use a supported reasoning-effort value as accepted by ReasoningEffort (e.g. minimal/low/medium/high per the current parser)
  2. Use 'default' or 'unset' to clear the override instead of an unknown word
  3. Check the inner {err} text for the exact accepted vocabulary
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/settings.rs:2550 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/53fd392cb44888dd. Report an issue: GitHub.