Hmbown/CodeWhale · warning

external credential consent cancelled; no configuration was…

Error message

external credential consent cancelled; no configuration was changed

What it means

The interactive consent prompt reads a line from the user; anything other than the exact string `yes` (after trimming) aborts the flow, guaranteeing no configuration change occurs. This is a deliberate user-initiated cancellation, not an internal fault.

Solutions

  1. Re-run the command and answer exactly `yes` to save consent
  2. If declining was intended, no action is needed — configuration is unchanged
Defensive patterns

Strategy: try-catch

Try / catch

try { saveExternalConsent(provider) } catch (e) { if (String(e).includes('consent cancelled')) { log('user declined; no changes made'); return; } throw e; }

Prevention

When it happens

Trigger: Answering the external-credential consent prompt with `no`, `y`, an empty line, EOF, or any input other than `yes`.

Common situations: Users typing `y` or Enter expecting acceptance; pressing Ctrl-D (EOF leaves answer empty); changed mind after reviewing the preview.

Related errors


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

Appendix: source

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

        bail!(
            "external credential consent was not saved: non-interactive use requires explicit --yes after reviewing the preview"
        );
    }
    confirm_external_consent_answer(&mut std::io::stdin().lock(), &mut std::io::stdout().lock())
}

fn confirm_external_consent_answer(
    reader: &mut impl std::io::BufRead,
    writer: &mut impl std::io::Write,
) -> Result<()> {
    write!(writer, "Type 'yes' to grant this exact read-only access: ")?;
    writer.flush()?;
    let mut answer = String::new();
    reader
        .read_line(&mut answer)
        .context("reading external credential consent confirmation")?;
    if answer.trim() != "yes" {
        bail!("external credential consent cancelled; no configuration was changed");
    }
    Ok(())
}

fn yes_no(b: bool) -> &'static str {
    if b { "yes" } else { "no " }
}

fn keyring_status_short(state: Option<bool>) -> &'static str {
    match state {
        Some(true) => "yes",
        Some(false) => "no ",
        None => "n/a",
    }
}

fn prompt_api_key(slot: &str) -> Result<String> {
    use std::io::{IsTerminal, Write};

View on GitHub (pinned to 73e0f67d83)