{"record":{"id":"b4dae451ffa8334d","repo":"Hmbown/CodeWhale","slug":"doctor-configuration-validation-failed-details-om","errorCode":null,"errorMessage":"doctor configuration validation failed; details omitted because configuration errors may contain credential material","messagePattern":"doctor configuration validation failed; details omitted because configuration errors may contain credential material","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":1990,"sourceCode":"    // first-call-wins; doing this once here keeps every downstream turn\n    // consistent. Missing files are a no-op (bundled defaults). See #3638.\n    crate::prompts::load_prompt_overrides_from_config_home();\n\n    // Plugins own one read-only discovery snapshot per process. Initialize it\n    // before the subcommand match so plain launch, resume, fork, exec, serve,\n    // and every other runtime surface use the same plugin trust decision\n    // (#3916, #4399). Discovery never enables, trusts, executes, or persists a\n    // bundle.\n\n    // Handle subcommands first\n    if let Some(command) = command {\n        return match command {\n            Commands::Doctor(args) => {\n                let config = match load_doctor_config_from_cli(&cli, &args) {\n                    Ok(config) => config,\n                    Err(error) if args.json => return run_doctor_json_config_error(&error),\n                    Err(_) => {\n                        bail!(\n                            \"doctor configuration validation failed; details omitted because configuration errors may contain credential material\"\n                        )\n                    }\n                };\n                let workspace = resolve_workspace(&cli);\n                if args.context_json {\n                    run_doctor_context_json(&config, &workspace)\n                } else if args.json {\n                    run_doctor_json(\n                        &config,\n                        &workspace,\n                        cli.config.as_deref(),\n                        plugin_registry.as_ref(),\n                    )\n                } else {\n                    let probes = crate::doctor::DoctorProbeRequest {\n                        check_updates: args.check_updates,\n                        probe_api: args.probe_api,","sourceCodeStart":1972,"sourceCodeEnd":2008,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L1972-L2008","documentation":"`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.","triggerScenarios":"`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.","commonSituations":"Running doctor interactively after editing the config; CI smoke checks calling plain doctor; a config hand-migrated between versions that no longer parses.","solutions":["Re-run `codewhale doctor --json` and read the structured config error field to identify the exact file/key","Fix the config issue named by the JSON error (syntax, key names, provider table shape)","Keep secrets out of config files so future validation errors are safe to display","In CI, always use --json and surface the structured error, not the redacted message"],"exampleFix":"# before\ncodewhale doctor\n# doctor configuration validation failed; details omitted because configuration errors may contain credential material\n\n# after\ncodewhale doctor --json   # structured config error identifying the offending file/key","handlingStrategy":"try-catch","validationCode":"# In CI, always request the structured error so nothing is lost to redaction\ncodewhale doctor --json > doctor.json 2>&1 || {\n  jq -r '.error // .config_error // .' doctor.json\n  exit 1\n}","typeGuard":null,"tryCatchPattern":"if ! codewhale doctor; then\n  # details are redacted on this path; re-run with --json to capture the structured error\n  codewhale doctor --json > doctor-error.json || true\n  exit 1\nfi","preventionTips":["Always script doctor with --json","Validate config edits before running doctor (parse the TOML in CI)","Keep credentials out of config so redaction never hides the real problem"],"tags":["doctor","config","credentials","diagnostics"],"backgroundTag":"config-validation-failed","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}