{"record":{"id":"6d006e148d1fe720","repo":"tinyhumansai/openhuman","slug":"search-query-cannot-be-empty","errorCode":null,"errorMessage":"Search query cannot be empty","messagePattern":"Search query cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/brave.rs","lineNumber":119,"sourceCode":"        status = %status,\n        elapsed_ms = elapsed_ms as u64,\n        body_bytes = body.len(),\n        \"[brave] response ok\"\n    );\n    serde_json::from_str::<Value>(&body).map_err(|e| {\n        tracing::warn!(path = %path, \"[brave] JSON parse failed: {e}\");\n        anyhow::anyhow!(\"Brave returned malformed JSON: {e}\")\n    })\n}\n\nfn extract_query(args: &Value) -> anyhow::Result<String> {\n    let q = args\n        .get(\"query\")\n        .and_then(|v| v.as_str())\n        .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter: query\"))?\n        .trim();\n    if q.is_empty() {\n        anyhow::bail!(\"Search query cannot be empty\");\n    }\n    Ok(q.to_string())\n}\n\nfn clamped_count(args: &Value, default: usize, max: usize) -> usize {\n    args.get(\"count\")\n        .and_then(|v| v.as_u64())\n        .map(|n| (n as usize).clamp(1, max))\n        .unwrap_or_else(|| default.clamp(1, max))\n}\n\nfn pub_string(args: &Value, key: &str) -> Option<String> {\n    args.get(key)\n        .and_then(|v| v.as_str())\n        .map(|s| s.trim().to_string())\n        .filter(|s| !s.is_empty())\n}\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/brave.rs#L101-L137","documentation":"extract_query found the `query` argument present but blank after trimming — an argument-shape error from the calling model, not a Brave-side failure. The missing-parameter case is a separate error.","triggerScenarios":"Thrown at src/openhuman/search/tools/brave.rs:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-issue the tool call with a non-empty query string"],"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"}