{"record":{"id":"d0b1561406510bb4","repo":"Kuberwastaken/claurst","slug":"minimaxprovider-failed-to-build-http-client","errorCode":null,"errorMessage":"MinimaxProvider: failed to build HTTP client","messagePattern":"MinimaxProvider: failed to build HTTP client","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src-rust/crates/api/src/providers/minimax.rs","lineNumber":42,"sourceCode":"pub struct MinimaxProvider {\n    http_client: Client,\n    api_key: String,\n    api_base: String,\n    service_tier: Option<String>,\n    id: ProviderId,\n}\n\nimpl MinimaxProvider {\n    pub fn new(api_key: String) -> Self {\n        let api_base = std::env::var(\"MINIMAX_BASE_URL\")\n            .unwrap_or_else(|_| claurst_core::constants::MINIMAX_ANTHROPIC_API_BASE.to_string());\n        let mut headers = header::HeaderMap::new();\n        headers.insert(\"X-Api-Key\", header::HeaderValue::from_str(&api_key).expect(\"unable to parse api key for http header\"));\n        let http_client = Client::builder()\n            .default_headers(headers)\n            .timeout(crate::request_timeout())\n            .build()\n            .expect(\"MinimaxProvider: failed to build HTTP client\");\n\n        Self {\n            http_client,\n            api_key,\n            api_base,\n            service_tier: None,\n            id: ProviderId::new(ProviderId::MINIMAX),\n        }\n    }\n\n    pub fn with_base_url(mut self, api_base: impl Into<String>) -> Self {\n        self.api_base = api_base.into();\n        self\n    }\n\n    pub fn with_service_tier(mut self, service_tier: impl Into<String>) -> Self {\n        self.service_tier = Some(service_tier.into());\n        self","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/api/src/providers/minimax.rs#L24-L60","documentation":"MinimaxProvider::new builds a reqwest Client with the prepared default headers and request timeout, and .expect()s the build result, panicking with 'MinimaxProvider: failed to build HTTP client'. As with other reqwest build failures, this practically only happens when the TLS backend cannot initialize.","triggerScenarios":"Constructing MinimaxProvider::new(api_key) where reqwest's Client::builder().build() fails after the X-Api-Key default header was installed.","commonSituations":"Builds missing a TLS backend; musl/cross-compiled binaries without OpenSSL; minimal container images lacking CA certificates; conflicting reqwest feature flags.","solutions":["Enable a reqwest TLS backend (rustls-tls or default-tls) in Cargo features.","Unify reqwest features with `cargo tree -i reqwest` to eliminate conflicts.","Use rustls-tls for static/cross builds; install ca-certificates in slim containers.","Reproduce by building a bare reqwest client and logging the returned error.","Replace the expect with a fallible constructor returning Result."],"exampleFix":"// before\n.expect(\"MinimaxProvider: failed to build HTTP client\");\n// after\n.build()\n.context(\"building Minimax HTTP client\")?;","handlingStrategy":"try-catch","validationCode":"reqwest::Client::builder().timeout(crate::request_timeout()).build()\n    .map_err(|e| anyhow!(\"reqwest/TLS init failed: {e}\"))?;","typeGuard":null,"tryCatchPattern":"let http_client = reqwest::Client::builder()\n    .default_headers(headers)\n    .timeout(crate::request_timeout())\n    .build()\n    .map_err(|e| anyhow!(\"failed to build Minimax HTTP client: {e}\"))?;","preventionTips":["Enable a TLS backend (rustls-tls preferred) in Cargo features.","Check reqwest feature unification with cargo tree -i reqwest.","Install CA certificates in minimal images.","Run a startup smoke test that builds all providers."],"tags":["panic","http-client","tls","reqwest"],"backgroundTag":"internal-invariant-violation","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}