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 half of the consent flow: `confirm_external_consent_answer` prompts `Type 'yes' to grant this exact read-only access:` and requires the exact string `yes` (after trimming). Any other answer — `y`, `Y`, `no`, Enter, EOF-drained input — cancels the operation before any configuration is changed, and this error reports the clean abort.

Source

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

        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 0c42157ee5)

Solutions

  1. Re-run the command and type exactly `yes` at the prompt
  2. Use `--yes` to skip the interactive prompt entirely in trusted contexts
  3. For automation, drive the prompt with the literal string: `printf 'yes\n' | codewhale ...` only when stdin-interactive is desired — prefer `--yes`

Example fix

# before
Type 'yes' to grant this exact read-only access: y
# external credential consent cancelled; no configuration was changed

# after
Type 'yes' to grant this exact read-only access: yes
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
# skip the fragile interactive token entirely when the grant is intentional
exec codewhale external-credentials --provider grok --mode read-only --yes

Prevention

When it happens

Trigger: Answering the consent prompt with anything other than exactly `yes`; accidental Enter; a terminal that sends the answer without a trailing newline handling; answering `y` out of habit from other confirmation prompts.

Common situations: Users used to `y`-style confirmations; scripted expect-like drivers typing the wrong token; changing your mind at the prompt (the intended, safe behavior).

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/978bac8c13b89460. Report an issue: GitHub.