Hmbown/CodeWhale · error

invalid --set telemetry: expected a boolean

Error message

invalid --set telemetry: expected a boolean

What it means

--set telemetry parsing: the value supplied for the telemetry key is not a parseable boolean; the dispatcher's --set validation rejects it so an unparseable telemetry override never reaches the TUI environment.

Solutions

  1. Pass an explicit boolean: --set telemetry=true or --set telemetry=false
  2. Check quoting in your shell so '=' reaches the CLI (quote the whole arg if needed)
  3. Edit telemetry directly in the config file if CLI shorthand is problematic

Example fix

// before
$ codewhale --set telemetry=yes
// after
$ codewhale --set telemetry=true
Defensive patterns

Strategy: validation

Validate before calling

// only booleans are accepted
case "$val" in true|false) ;; *) echo "--set telemetry expects true|false"; exit 2;; esac

Type guard

fn is_bool_str(s: &str) -> bool { matches!(s, "true" | "false") }

Try / catch

match cli.run() {
    Err(e) if e.to_string().contains("invalid --set telemetry") => {
        eprintln!("telemetry must be true or false");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Running `codewhale ... --set telemetry=yes`, `--set telemetry=1`, or `--set telemetry=` with anything other than a recognized boolean (e.g. true/false).

Common situations: Users familiar with other tools' truthy syntax passing 'yes'/'on'/'1' instead of true/false.

Understand the failure class

Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.

Related errors


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

Appendix: source

Thrown at crates/cli/src/lib.rs:1913

        let (key, value) = spec
            .split_once('=')
            .context("invalid --set: expected KEY=VALUE (value omitted)")?;
        match key.trim() {
            "provider" => {
                provider = Some(
                    parse_provider_identifier(value)
                        .map_err(|_| anyhow!("invalid --set provider (value omitted)"))?,
                );
            }
            "model" | "default_text_model" => values.model = Some(value.to_string()),
            "verbosity" => values.verbosity = Some(value.to_string()),
            "approval_policy" => values.approval_policy = Some(value.to_string()),
            "sandbox_mode" => values.sandbox_mode = Some(value.to_string()),
            "telemetry" => {
                let mut config = ConfigToml::default();
                config
                    .set_value("telemetry", value)
                    .map_err(|_| anyhow!("invalid --set telemetry: expected a boolean"))?;
                values.telemetry = config.telemetry;
            }
            _ => bail!(
                "unsupported runtime --set key (value omitted): supported keys are provider, \
                 model, default_text_model, verbosity, approval_policy, sandbox_mode and \
                 telemetry; use the dedicated option or config set for other keys"
            ),
        }
        if value.trim().is_empty() {
            bail!("invalid runtime --set: value must not be empty");
        }
    }
    // A dedicated flag is more specific than a generic --set for the same
    // field. Repeated --set keys otherwise keep their last value.
    cli.provider = cli.provider.take().or(provider);
    cli.model = cli.model.take().or(values.model);
    cli.verbosity = cli.verbosity.take().or(values.verbosity);
    cli.approval_policy = cli.approval_policy.take().or(values.approval_policy);

View on GitHub (pinned to 73e0f67d83)