Hmbown/CodeWhale · error · anyhow::Error

read `codewhale config telemetry`, then explicitly accept…

Error message

read `codewhale config telemetry`, then explicitly accept current notice version {}

What it means

`codewhale config telemetry-accept <version>` requires the caller to pass the version number matching the current telemetry notice version. Passing a stale or wrong version bails with instructions to read the current notice via `codewhale config telemetry` first. This is a deliberate read-before-accept gate so consent is always explicit and informed.

Solutions

  1. Run `codewhale config telemetry` to read the current notice and its version
  2. Re-run accept passing the current version shown in the notice
  3. Remove any hard-coded version from scripts and derive it from the telemetry notice output

Example fix

// before
codewhale config telemetry-accept 1
// after
VERSION=$(codewhale config telemetry --print-version)
codewhale config telemetry-accept "$VERSION"
Defensive patterns

Strategy: validation

Validate before calling

// read the current version first, never hard-code it
let notice = run("codewhale config telemetry")?; // parse notice version from output
assert_eq!(version_arg, notice.version);

Try / catch

match result { Err(e) if e.to_string().contains("explicitly accept current notice version") => { let v = read_current_notice_version()?; retry_with_version(v); }, other => other? }

Prevention

When it happens

Trigger: Calling accept_telemetry_notice with a version argument that differs from codewhale_config::TELEMETRY_NOTICE_VERSION — e.g. hard-coded old version in a script, cached value from before a codewhale upgrade bumped the notice.

Common situations: Scripting the accept command with a literal version that has since been bumped; skipping the `codewhale config telemetry` read step; copy-pasted commands from old docs.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at crates/tui/src/lib.rs:2091

}

fn arm_telemetry(cli: &Cli, command: Option<&Commands>) {
    if telemetry_command_is_read_only(command) {
        return;
    }
    arm_telemetry_with_setup(
        cli.config.clone(),
        telemetry_surface(command),
        telemetry_session_source(command),
        None,
    );
}

/// Compatibility command to explicitly enable usage under the current policy.
/// This optional choice never arms the current process.
pub fn accept_telemetry_notice(config_path: Option<PathBuf>, version: u32) -> Result<String> {
    if version != codewhale_telemetry::NOTICE_VERSION {
        anyhow::bail!(
            "read `codewhale config telemetry`, then explicitly accept current notice version {}",
            codewhale_config::TELEMETRY_NOTICE_VERSION
        );
    }
    set_telemetry_preference(config_path, true)
}

/// Set the durable usage preference through the same transition as Settings.
/// Enabling affects the next launch; disabling immediately erases queued usage.
pub fn set_telemetry_preference(config_path: Option<PathBuf>, enabled: bool) -> Result<String> {
    let applied = crate::telemetry_notice::apply_persistent_preference(config_path, enabled);
    let message = applied.message(codewhale_localization::Locale::En);
    if applied.is_error() {
        anyhow::bail!("{message}");
    }
    Ok(message)
}

View on GitHub (pinned to 73e0f67d83)