Hmbown/CodeWhale · error · anyhow::Error

doctor configuration validation failed; details omitted…

Error message

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

What it means

When the `doctor` subcommand cannot load and validate configuration (load_doctor_config_from_cli returns Err) and the invocation is not `--json`, the CLI deliberately bails with a generic message that omits the underlying validation details, because config errors may embed credential material (API keys, tokens). The real details are only surfaced through run_doctor_json_config_error in JSON mode.

Solutions

  1. Re-run with --json (codewhale doctor --json) to get structured, redacted validation details.
  2. Fix the config field the JSON output reports; common ones are missing provider API keys or invalid model routes.
  3. Validate the config file path you passed via --config; ensure it is the intended file.
  4. If details are truly needed, inspect the config manually but scrub secrets before sharing.

Example fix

// before
codewhale doctor
// after
codewhale doctor --json   # prints structured config-validation errors instead of the redacted bail
Defensive patterns

Strategy: validation

Validate before calling

// shell
codewhale doctor --json | jq -e '.config_valid == true' || echo 'fix config before proceeding'

Prevention

When it happens

Trigger: Running `codewhale doctor` with a config that fails validation (missing required fields, invalid values, malformed file) without --json.

Common situations: Typo'd or missing API key fields, malformed TOML config, schema drift after upgrading Codewhale, or env-sourced credential placeholders that fail validation.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

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

    // 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 73e0f67d83)