{"record":{"id":"94f2a108d536ee32","repo":"tinyhumansai/openhuman","slug":"failed-to-build-brave-http-client-e","errorCode":null,"errorMessage":"failed to build Brave HTTP client: {e}","messagePattern":"failed to build Brave HTTP client: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/brave.rs","lineNumber":32,"sourceCode":"//!\n//! Each tool short-circuits with a clear \"not configured\" error when no\n//! key is wired up so the agent surfaces the misconfiguration instead\n//! of silently routing elsewhere.\n\nuse crate::openhuman::tools::traits::{Tool, ToolCallOptions, ToolResult};\nuse async_trait::async_trait;\nuse serde::Deserialize;\nuse serde_json::{json, Value};\nuse std::time::Duration;\n\nconst DEFAULT_API_BASE: &str = \"https://api.search.brave.com/res/v1\";\n\nfn http_client(timeout_secs: u64) -> anyhow::Result<reqwest::Client> {\n    crate::openhuman::util::tls::tls_client_builder()\n        .timeout(Duration::from_secs(timeout_secs.max(1)))\n        .connect_timeout(Duration::from_secs(10))\n        .build()\n        .map_err(|e| anyhow::anyhow!(\"failed to build Brave HTTP client: {e}\"))\n}\n\n#[derive(Debug, Clone)]\nstruct BraveConfig {\n    api_key: Option<String>,\n    max_results: usize,\n    timeout_secs: u64,\n}\n\nimpl BraveConfig {\n    fn require_key(&self) -> anyhow::Result<&str> {\n        self.api_key\n            .as_deref()\n            .map(str::trim)\n            .filter(|s| !s.is_empty())\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Brave Search unavailable: no API key configured. \\","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/brave.rs#L14-L50","documentation":"Building the reqwest HTTP client for the Brave Search tools failed inside the `http_client` helper. The client is constructed from the shared TLS builder with a timeout, so this fires when the TLS backend cannot initialize (native TLS library issues on the host) or client builder configuration is rejected. It is an environment/infrastructure failure, not a search-query problem.","triggerScenarios":"Thrown at src/openhuman/search/tools/brave.rs:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the platform TLS libraries are installed and healthy (e.g. up-to-date ca-certificates on Linux)","Retry after ruling out transient system resource exhaustion (file descriptor limits can block client creation)","If it persists, capture the chained inner error — it distinguishes TLS init failure from builder misconfiguration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}