{"record":{"id":"89f1a59763b07089","repo":"tinyhumansai/openhuman","slug":"brave-search-unavailable-no-api-key-configured-s","errorCode":null,"errorMessage":"Brave Search unavailable: no API key configured. Set OPENHUMAN_BRAVE_API_KEY or `search.brave.api_key` in config.toml and select `search.engine = \"brave\"`.","messagePattern":"Brave Search unavailable: no API key configured\\. Set OPENHUMAN_BRAVE_API_KEY or `search\\.brave\\.api_key` in config\\.toml and select `search\\.engine = \"brave\"`\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/brave.rs","lineNumber":49,"sourceCode":"        .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. \\\n                     Set OPENHUMAN_BRAVE_API_KEY or `search.brave.api_key` \\\n                     in config.toml and select `search.engine = \\\"brave\\\"`.\"\n                )\n            })\n    }\n}\n\nasync fn brave_get(\n    cfg: &BraveConfig,\n    path: &str,\n    query: &[(&str, String)],\n) -> anyhow::Result<Value> {\n    let key = cfg.require_key()?;\n    let url = format!(\"{DEFAULT_API_BASE}{path}\");\n    tracing::debug!(\n        path = %path,\n        timeout_secs = cfg.timeout_secs,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/brave.rs#L31-L67","documentation":"A configuration sentinel from `BraveConfig::require_key`: the Brave Search tools short-circuit because no usable API key is wired up. The key is read from `OPENHUMAN_BRAVE_API_KEY` or `search.brave.api_key` in config.toml; entries that are empty or whitespace-only are treated as absent by design. The tool deliberately fails loudly so the agent surfaces the misconfiguration instead of silently routing to another engine.","triggerScenarios":"Thrown at src/openhuman/search/tools/brave.rs:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Export `OPENHUMAN_BRAVE_API_KEY=<key>` in the environment","Or set `search.brave.api_key` in config.toml and select `search.engine = \"brave\"`","Verify the key is non-empty after trimming — a blank value still triggers this error"],"exampleFix":null,"handlingStrategy":"validation","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"}