Hmbown/CodeWhale · info

import cancelled; no configuration was changed

Error message

import cancelled; no configuration was changed

What it means

require_import_consent prompts 'Type yes:' on a terminal and bails when the typed answer (trimmed) is anything other than 'yes'. This is the user-declined path: nothing was applied, so the error states no configuration was changed.

Solutions

  1. Re-run the import and type exactly `yes` (lowercase, full word) when prompted.
  2. For scripts, pass `--yes` instead of piping an answer into stdin.
  3. Review the printed plan (added/changed counts) first if the decline was intentional, then re-run when ready.

Example fix

Apply this bundle (3 added, 1 changed)? Type 'yes': y
// refused
Apply this bundle (3 added, 1 changed)? Type 'yes': yes
// applied
Defensive patterns

Strategy: try-catch

Try / catch

if let Err(e) = run_import(&args, &store) {
    if e.to_string() == "import cancelled; no configuration was changed" {
        eprintln!("declined by user; config untouched — re-run and type exactly 'yes'");
    }
}

Prevention

When it happens

Trigger: Answering the interactive import confirmation with anything except the literal 'yes' (e.g. 'y', 'Y', Enter, 'no'), causing require_import_consent to bail before apply_bundle writes.

Common situations: Users typing 'y' out of habit at the confirmation prompt; accidentally pressing Enter to dismiss; pasting a command where stdin carries a non-'yes' first line.

Related errors


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

Appendix: source

Thrown at crates/cli/src/config_bundles.rs:1444

    }
    if !std::io::stdin().is_terminal() {
        bail!(
            "import refused: non-interactive use requires explicit --yes after reviewing the plan"
        );
    }
    print!(
        "Apply this bundle ({} added, {} changed)? Type 'yes': ",
        plan.added.len(),
        plan.changed.len()
    );
    use std::io::Write;
    std::io::stdout().flush()?;
    let mut answer = String::new();
    std::io::stdin()
        .read_line(&mut answer)
        .context("reading import consent")?;
    if answer.trim() != "yes" {
        bail!("import cancelled; no configuration was changed");
    }
    Ok(())
}

// ---------------------------------------------------------------------------
// CLI surface
// ---------------------------------------------------------------------------

/// Arguments for `codewhale config import`.
#[derive(Debug, clap::Args)]
pub struct ImportArgs {
    /// Bundle source: a file path, an HTTPS URL, or `-` for stdin.
    pub source: String,
    /// Print the deterministic import plan without writing anything.
    #[arg(long, default_value_t = false)]
    dry_run: bool,
    /// Skip the interactive consent prompt (required for headless use).
    #[arg(long, default_value_t = false)]

View on GitHub (pinned to 73e0f67d83)