Hmbown/CodeWhale · error

Failed to update setting: invalid inline diff mode

Error message

Failed to update setting: invalid inline diff mode '{value}'. Expected: full, summary, or off.

What it means

The settings setter rejected the value for `inline_diffs`, which controls how inline diffs render. Only full, summary, or off (case-insensitive, trimmed) are accepted. The guard keeps the stored mode aligned with the renderer's supported modes.

Solutions

  1. Use one of: full, summary, or off.
  2. Use `off` to disable inline diffs rather than an unlisted mode.
  3. Trim whitespace/case issues; normalization already handles case but not unknown words.

Example fix

// before
settings.set("diffs", "side-by-side")
// after
settings.set("diffs", "summary")
Defensive patterns

Strategy: validation

Validate before calling

const DIFF_MODES: [&str; 3] = ["full", "summary", "off"];
fn valid_inline_diff_mode(v: &str) -> bool {
    DIFF_MODES.contains(&v.trim().to_ascii_lowercase().as_str())
}

Try / catch

if let Err(e) = settings.set("inline_diffs", value) {
    eprintln!("{e}");
}

Prevention

When it happens

Trigger: Settings update with key `inline_diffs` (aliases `inline_diff`, `diffs`) and a value outside {full, summary, off}, e.g. `set diffs side-by-side`.

Common situations: Expecting a side-by-side mode that this TUI does not offer; typos like `sumary`; config copied from another tool's diff setting.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/17cf7400493451c7. Report an issue: GitHub.

Appendix: source

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

            "thinking_highlight" | "reasoning_highlight" => {
                self.thinking_highlight = parse_bool(value)?;
            }
            "help_expand_groups" | "help_expanded" => {
                self.help_expand_groups = parse_bool(value)?;
            }
            "contextual_tips" => {
                self.contextual_tips = parse_bool(value)?;
            }
            "pin_last_prompt" | "pin_prompt" => {
                self.pin_last_prompt = parse_bool(value)?;
            }
            "show_tool_details" | "tool_details" => {
                self.show_tool_details = parse_bool(value)?;
            }
            "inline_diffs" | "inline_diff" | "diffs" => {
                let normalized = value.trim().to_ascii_lowercase();
                if !matches!(normalized.as_str(), "full" | "summary" | "off") {
                    anyhow::bail!(
                        "Failed to update setting: invalid inline diff mode '{value}'. Expected: full, summary, or off."
                    );
                }
                self.inline_diffs = normalized;
            }
            "locale" | "language" => {
                let Some(locale) = normalize_configured_locale(value) else {
                    anyhow::bail!(
                        "Failed to update setting: invalid locale '{value}'. Expected: {}.",
                        codewhale_localization::configured_locale_values(", ")
                    );
                };
                self.locale = locale.to_string();
            }
            "theme" | "ui_theme" => {
                self.theme = normalize_theme_setting(value).map_err(anyhow::Error::msg)?;
            }
            "background_color" | "background" | "bg" => {

View on GitHub (pinned to 73e0f67d83)