{"record":{"id":"d3900493abf65302","repo":"Hmbown/CodeWhale","slug":"profile-profile-name-not-found-available-prof","errorCode":null,"errorMessage":"Profile '{profile_name}' not found. Available profiles: {available}","messagePattern":"Profile '(.+?)' not found\\. Available profiles: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":9640,"sourceCode":"\nfn apply_profile(config: ConfigFile, profile: Option<&str>) -> Result<Config> {\n    if let Some(profile_name) = profile {\n        let profiles = config.profiles.as_ref();\n        match profiles.and_then(|profiles| profiles.get(profile_name)) {\n            Some(override_cfg) => Ok(merge_config(config.base, override_cfg.clone())),\n            None => {\n                let available = profiles\n                    .map(|profiles| {\n                        let mut keys = profiles.keys().cloned().collect::<Vec<_>>();\n                        keys.sort();\n                        if keys.is_empty() {\n                            \"none\".to_string()\n                        } else {\n                            keys.join(\", \")\n                        }\n                    })\n                    .unwrap_or_else(|| \"none\".to_string());\n                anyhow::bail!(\"Profile '{profile_name}' not found. Available profiles: {available}\")\n            }\n        }\n    } else {\n        Ok(config.base)\n    }\n}\n\nfn merge_config(base: Config, override_cfg: Config) -> Config {\n    // Captured before the struct literal moves the field out of `override_cfg`.\n    let override_defines_root_base_url = override_cfg.base_url.is_some();\n    Config {\n        provider: override_cfg.provider.or(base.provider),\n        api_key: override_cfg.api_key.or(base.api_key),\n        base_url: override_cfg.base_url.or(base.base_url),\n        http_headers: override_cfg.http_headers.or(base.http_headers),\n        default_text_model: override_cfg.default_text_model.or(base.default_text_model),\n        auth_mode: override_cfg.auth_mode.or(base.auth_mode),\n        reasoning_effort: override_cfg.reasoning_effort.or(base.reasoning_effort),","sourceCodeStart":9622,"sourceCodeEnd":9658,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/config.rs#L9622-L9658","documentation":"Error \"Profile '{profile_name}' not found. Available profiles: {available}\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/config.rs:9640 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}