{"record":{"id":"cfb8bee029bf8709","repo":"tinyhumansai/openhuman","slug":"failed-to-parse-querit-response-e","errorCode":null,"errorMessage":"Failed to parse Querit response: {e}","messagePattern":"Failed to parse Querit response: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/querit.rs","lineNumber":315,"sourceCode":"        }\n\n        if filters.is_empty() {\n            None\n        } else {\n            Some(Value::Object(filters))\n        }\n    }\n\n    fn decode_response(value: Value) -> anyhow::Result<QueritSearchResponse> {\n        let payload = value\n            .get(\"response_data\")\n            .and_then(|v| v.get(\"aiapi_res\"))\n            .or_else(|| value.get(\"aiapi_res\"))\n            .cloned()\n            .unwrap_or(value);\n        serde_json::from_value(payload).map_err(|e| {\n            tracing::warn!(\"[querit] failed to parse response: {e}\");\n            anyhow::anyhow!(\"Failed to parse Querit response: {e}\")\n        })\n    }\n}\n\nimpl QueritResultItem {\n    fn snippet_text(&self) -> Option<String> {\n        self.snippet\n            .as_deref()\n            .map(str::trim)\n            .filter(|s| !s.is_empty())\n            .map(str::to_string)\n            .or_else(|| {\n                let joined = self\n                    .sentence\n                    .iter()\n                    .map(|s| s.trim())\n                    .filter(|s| !s.is_empty())\n                    .collect::<Vec<_>>()","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/querit.rs#L297-L333","documentation":"Raised in QueritClient::decode_response when serde_json::from_value cannot deserialize the extracted Querit payload into QueritSearchResponse. The function first unwraps Querit's envelope — trying response_data.aiapi_res, then top-level aiapi_res, then the raw value — so this error means even after envelope unwrapping the JSON does not match the expected response schema (upstream API drift or a proxy/HTML body). A tracing::warn! records the serde detail before the tool error is returned.","triggerScenarios":"Thrown at src/openhuman/search/tools/querit.rs:315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log the raw payload (at debug level) and compare against current Querit API response docs; update QueritSearchResponse accordingly.","Make struct fields Option/#[serde(default)] where Querit omits them, and add aliases for renamed fields.","Retry the search — a cached or proxied HTML error page is usually transient.","Fall back to another search provider if Querit remains unparseable."],"exampleFix":null,"handlingStrategy":"fallback","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-14T00:17:10.932Z"}