tinyhumansai/openhuman · error
Failed to parse Querit response: {e}
Error message
Failed to parse Querit response: {e} What it means
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.
Source
Thrown at src/openhuman/search/tools/querit.rs:315
}
if filters.is_empty() {
None
} else {
Some(Value::Object(filters))
}
}
fn decode_response(value: Value) -> anyhow::Result<QueritSearchResponse> {
let payload = value
.get("response_data")
.and_then(|v| v.get("aiapi_res"))
.or_else(|| value.get("aiapi_res"))
.cloned()
.unwrap_or(value);
serde_json::from_value(payload).map_err(|e| {
tracing::warn!("[querit] failed to parse response: {e}");
anyhow::anyhow!("Failed to parse Querit response: {e}")
})
}
}
impl QueritResultItem {
fn snippet_text(&self) -> Option<String> {
self.snippet
.as_deref()
.map(str::trim)
.filter(|s| !s.is_empty())
.map(str::to_string)
.or_else(|| {
let joined = self
.sentence
.iter()
.map(|s| s.trim())
.filter(|s| !s.is_empty())
.collect::<Vec<_>>()View on GitHub (pinned to 7491200858)
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.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/openhuman/search/tools/querit.rs:315 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17).
Data as JSON: /api/errors/cfb8bee029bf8709.
Report an issue: GitHub.