Hmbown/CodeWhale · error · anyhow::Error

doctor configuration validation failed; details omitted beca

Error message

doctor configuration validation failed; details omitted because configuration errors may contain credential material

What it means

`codewhale doctor` validates configuration before running its checks, and validation errors can embed credential material (parse failures that echo values, API keys inside provider tables). On the human-readable path the details are deliberately omitted from the bail message; the safe channel is `--json`, which routes through run_doctor_json_config_error and returns the structured error that tooling can inspect without leaking secrets to the terminal.

Source

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

    // first-call-wins; doing this once here keeps every downstream turn
    // consistent. Missing files are a no-op (bundled defaults). See #3638.
    crate::prompts::load_prompt_overrides_from_config_home();

    // Plugins own one read-only discovery snapshot per process. Initialize it
    // before the subcommand match so plain launch, resume, fork, exec, serve,
    // and every other runtime surface use the same plugin trust decision
    // (#3916, #4399). Discovery never enables, trusts, executes, or persists a
    // bundle.

    // Handle subcommands first
    if let Some(command) = command {
        return match command {
            Commands::Doctor(args) => {
                let config = match load_doctor_config_from_cli(&cli, &args) {
                    Ok(config) => config,
                    Err(error) if args.json => return run_doctor_json_config_error(&error),
                    Err(_) => {
                        bail!(
                            "doctor configuration validation failed; details omitted because configuration errors may contain credential material"
                        )
                    }
                };
                let workspace = resolve_workspace(&cli);
                if args.context_json {
                    run_doctor_context_json(&config, &workspace)
                } else if args.json {
                    run_doctor_json(
                        &config,
                        &workspace,
                        cli.config.as_deref(),
                        plugin_registry.as_ref(),
                    )
                } else {
                    let probes = crate::doctor::DoctorProbeRequest {
                        check_updates: args.check_updates,
                        probe_api: args.probe_api,

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Re-run `codewhale doctor --json` and read the structured config error field to identify the exact file/key
  2. Fix the config issue named by the JSON error (syntax, key names, provider table shape)
  3. Keep secrets out of config files so future validation errors are safe to display
  4. In CI, always use --json and surface the structured error, not the redacted message

Example fix

# before
codewhale doctor
# doctor configuration validation failed; details omitted because configuration errors may contain credential material

# after
codewhale doctor --json   # structured config error identifying the offending file/key
Defensive patterns

Strategy: try-catch

Validate before calling

# In CI, always request the structured error so nothing is lost to redaction
codewhale doctor --json > doctor.json 2>&1 || {
  jq -r '.error // .config_error // .' doctor.json
  exit 1
}

Try / catch

if ! codewhale doctor; then
  # details are redacted on this path; re-run with --json to capture the structured error
  codewhale doctor --json > doctor-error.json || true
  exit 1
fi

Prevention

When it happens

Trigger: `codewhale doctor` with an invalid config: malformed TOML, unknown or misplaced keys, invalid provider tables, or values containing secrets — and neither --json nor --context-json supplied.

Common situations: Running doctor interactively after editing the config; CI smoke checks calling plain doctor; a config hand-migrated between versions that no longer parses.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


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