{"record":{"id":"76b1437049ab6228","repo":"Hmbown/CodeWhale","slug":"providerkind-variant-missing-from-provider-registr","errorCode":null,"errorMessage":"ProviderKind variant missing from PROVIDER_REGISTRY","messagePattern":"ProviderKind variant missing from PROVIDER_REGISTRY","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/provider.rs","lineNumber":1804,"sourceCode":"        .iter()\n        .copied()\n        .find(|provider| provider.id() == id)\n}\n\n/// Resolve a provider by canonical id or supported legacy alias.\n#[must_use]\npub fn resolve_provider(id_or_alias: &str) -> Option<&'static dyn Provider> {\n    ProviderKind::parse(id_or_alias).map(provider_for_kind)\n}\n\n/// Return metadata for a known provider kind.\n#[must_use]\npub fn provider_for_kind(kind: ProviderKind) -> &'static dyn Provider {\n    PROVIDER_REGISTRY\n        .iter()\n        .find(|p| p.kind() == kind)\n        .copied()\n        .expect(\"ProviderKind variant missing from PROVIDER_REGISTRY\")\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn credential_help_covers_every_provider_without_guessing_non_key_urls() {\n        for provider in all_providers() {\n            let help = provider.credential_help();\n            assert!(\n                !help.guidance.trim().is_empty(),\n                \"{} credential guidance must not be empty\",\n                provider.id()\n            );\n\n            match help.acquisition {\n                CredentialAcquisition::ApiKey | CredentialAcquisition::ApiKeyOrOAuth => {","sourceCodeStart":1786,"sourceCodeEnd":1822,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/config/src/provider.rs#L1786-L1822","documentation":"provider_for_kind() looks up a ProviderKind in the static PROVIDER_REGISTRY and unwraps, since every ProviderKind variant is required to have a registered provider descriptor. The panic fires only when a new ProviderKind variant is added without a matching registry entry — a build-time omission.","triggerScenarios":"Thrown at crates/config/src/provider.rs:1804 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register the new ProviderKind variant in PROVIDER_REGISTRY","Add a test asserting every ProviderKind variant resolves through the registry"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}