Hmbown/CodeWhale · error

agent profile reasoning_effort must be one of: inherit…

Error message

agent profile {} reasoning_effort {value:?} must be one of: inherit, auto, off, low, medium, high, max

What it means

Thrown by normalize_agent_profile_reasoning_effort when an agent profile's reasoning_effort value is present but is not one of the accepted enum values: inherit, auto, off, low, medium, high, max. The strict parser (ReasoningEffort::parse_strict) rejects the raw string and this anyhow error echoes the value with debug formatting plus the file path. It is a per-field enum validation gate applied while converting AgentProfileToml into an AgentProfile.

Solutions

  1. Set reasoning_effort in the profile to exactly one of: inherit, auto, off, low, medium, high, max (lowercase).
  2. Delete the reasoning_effort key entirely to inherit the default.
  3. If a custom intensity was intended, choose the nearest supported level (e.g. 'high' or 'max').

Example fix

// before
reasoning_effort = "Ultra"
// after
reasoning_effort = "max"
Defensive patterns

Strategy: validation

Validate before calling

// Rust
const VALID: [&str; 7] = ["inherit","auto","off","low","medium","high","max"];
if let Some(v) = parsed.reasoning_effort.as_deref() {
    assert!(VALID.contains(&v), "bad reasoning_effort {v}");
}

Type guard

fn is_valid_effort(v: &str) -> bool {
    matches!(v, "inherit"|"auto"|"off"|"low"|"medium"|"high"|"max")
}

Prevention

When it happens

Trigger: An agent profile .toml contains reasoning_effort = "<anything else>" — e.g. "medium-high", "Medium" (case-sensitive), "xhigh", an empty string, or a numeric value — and agent_profile_from_toml normalizes it.

Common situations: Copied a reasoning_effort value from another tool's config with different vocabulary; casing mismatch; thought 'ultra'/'extreme' were valid; left a placeholder value in the file.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at crates/tui/src/fleet/profile.rs:586

}

fn normalize_agent_profile_reasoning_effort(
    path: &Path,
    value: Option<&str>,
) -> Result<Option<String>> {
    let Some(value) = non_empty_trimmed(value) else {
        return Ok(None);
    };
    if matches!(
        value.to_ascii_lowercase().as_str(),
        "inherit" | "parent" | "same" | "current" | "default" | "unset"
    ) {
        return Ok(None);
    }
    ReasoningEffort::parse_strict(value)
        .map(|effort| Some(effort.as_setting().to_string()))
        .map_err(|_| {
            anyhow!(
                "agent profile {} reasoning_effort {value:?} must be one of: inherit, auto, off, low, medium, high, max",
                path.display()
            )
        })
}

fn is_agent_profile_token_char(ch: char) -> bool {
    ch.is_ascii_alphanumeric() || matches!(ch, '-' | '_' | '.')
}

fn is_model_hint(value: &str) -> bool {
    let trimmed = value.trim();
    !trimmed.is_empty()
        && trimmed == value
        && trimmed
            .chars()
            .all(|ch| ch.is_ascii_graphic() && !matches!(ch, '=' | '\'' | '"'))
}

View on GitHub (pinned to 73e0f67d83)