tinyhumansai/openhuman · error
Failed to parse Seltz response: {e}
Error message
Failed to parse Seltz response: {e} What it means
Response-deserialization guard in SeltzTool::execute_with_options: the request returned 2xx but the body could not be parsed into the expected Seltz search-response JSON structure — e.g. an HTML or empty body, or an API schema change. The serde error is logged and rewrapped with this message.
Source
Thrown at src/openhuman/search/tools/seltz.rs:307
.map_err(|e| {
tracing::warn!("[seltz] request failed: {e}");
anyhow::anyhow!("Seltz search request failed: {e}")
})?;
let status = resp.status();
if !status.is_success() {
let body_text = resp.text().await.unwrap_or_default();
let detail = utf8_safe_prefix_at_byte_boundary(&body_text, 500);
tracing::warn!(
status = %status,
"[seltz] non-2xx response: {detail}"
);
anyhow::bail!("Seltz returned {status}: {detail}");
}
let search_resp: SeltzSearchResponse = resp.json().await.map_err(|e| {
tracing::warn!("[seltz] failed to parse response: {e}");
anyhow::anyhow!("Failed to parse Seltz response: {e}")
})?;
tracing::debug!(
doc_count = search_resp.documents.len(),
"[seltz] search complete"
);
let mut result =
ToolResult::success(self.render_results_plain(&search_resp.documents, query));
if options.prefer_markdown {
result.markdown_formatted =
Some(self.render_results_markdown(&search_resp.documents, query));
}
Ok(result)
}
}
#[cfg(test)]View on GitHub (pinned to 7491200858)
Solutions
- Retry; intermittent malformed responses can be transient.
- Confirm the endpoint URL targets the Seltz API version matching the client's response model.
- Inspect the raw body in logs and update the Serde model if the contract changed.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/openhuman/search/tools/seltz.rs:307 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/4dbcaafe96ef7510.
Report an issue: GitHub.