zeroclaw-labs/zeroclaw · error

project_intel.default_language must be one of: en, de, fr, i

Error message

project_intel.default_language must be one of: en, de, fr, it (got '{lang}')

What it means

When project_intel.enabled is true, Config::validate() restricts project_intel.default_language to the supported set {en, de, fr, it}; any other string bails with the offending value echoed. The whitelist exists because the project-intelligence templates and analysis pipelines are only localized for those four languages, so an unsupported locale would degrade at runtime rather than fail clearly.

Source

Thrown at crates/zeroclaw-config/src/schema.rs:21943

            let sub_key = operation
                .sub_resource
                .as_deref()
                .map(str::trim)
                .unwrap_or("");
            let operation_key = format!("{service}:{resource}:{sub_key}");
            if !seen_gws_operations.insert(operation_key.clone()) {
                anyhow::bail!(
                    "google_workspace.allowed_operations contains duplicate service/resource/sub_resource entry: {operation_key}"
                );
            }
        }

        // Project intelligence
        if self.project_intel.enabled {
            let lang = &self.project_intel.default_language;
            if !["en", "de", "fr", "it"].contains(&lang.as_str()) {
                anyhow::bail!(
                    "project_intel.default_language must be one of: en, de, fr, it (got '{lang}')"
                );
            }
            let sens = &self.project_intel.risk_sensitivity;
            if !["low", "medium", "high"].contains(&sens.as_str()) {
                anyhow::bail!(
                    "project_intel.risk_sensitivity must be one of: low, medium, high (got '{sens}')"
                );
            }
            if let Some(ref tpl_dir) = self.project_intel.templates_dir
                && !std::path::Path::new(tpl_dir).exists()
            {
                anyhow::bail!("project_intel.templates_dir path does not exist: {tpl_dir}");
            }
        }

        // Proxy (delegate to existing validation)
        self.proxy.validate()?;

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Set default_language to one of en, de, fr, it (lowercase, no region suffix)
  2. If you need a different locale, disable project_intel or request/await support for it
  3. Keep the value locale-only: "de" not "de-DE"

Example fix

# before
[project_intel]
enabled = true
default_language = "es"

# after
[project_intel]
enabled = true
default_language = "en"
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_LANGS: [&str; 4] = ["en", "de", "fr", "it"];
fn language_ok(lang: &str) -> bool {
    SUPPORTED_LANGS.contains(&lang)
}

Type guard

fn language_ok(lang: &str) -> bool { ["en", "de", "fr", "it"].contains(&lang) }

Try / catch

match config.validate() {
    Ok(()) => {}
    Err(e) if e.to_string().starts_with("project_intel.default_language") => {
        // pick one of en/de/fr/it (lowercase, no region subtag)
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: A config with [project_intel] enabled = true and default_language = "es" (or "EN", "jp", "zh-CN") being validated via Config::validate().

Common situations: Porting a config from another deployment with a different locale; assuming the full BCP-47 tag space is accepted ("en-US" fails); case mismatches like "EN"; upgrading to a version whose language set changed.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/765798d60805afe6. Report an issue: GitHub.