tinyhumansai/openhuman · error · anyhow::Error

invalid filter: {e}

Error message

invalid filter: {e}

What it means

parse_filter: the 'filter' value was present but serde failed to deserialize it into FilterSpec — typically wrong field names, wrong types, or unknown/misspelled keys. The serde error text is appended.

Source

Thrown at src/openhuman/integrations/task_sources/tools.rs:56

fn opt_str(args: &serde_json::Value, key: &str) -> Option<String> {
    args.get(key)
        .and_then(serde_json::Value::as_str)
        .map(str::trim)
        .filter(|s| !s.is_empty())
        .map(str::to_string)
}

fn parse_provider(args: &serde_json::Value) -> anyhow::Result<ProviderSlug> {
    let raw = read_required_str(args, "provider")?;
    ProviderSlug::parse(&raw).map_err(|e| anyhow::anyhow!("invalid provider: {e}"))
}

fn parse_filter(args: &serde_json::Value) -> anyhow::Result<FilterSpec> {
    let val = args
        .get("filter")
        .cloned()
        .ok_or_else(|| anyhow::anyhow!("missing required object argument `filter`"))?;
    serde_json::from_value(val).map_err(|e| anyhow::anyhow!("invalid filter: {e}"))
}

macro_rules! emit {
    ($outcome:expr, $name:literal) => {{
        let outcome = $outcome.map_err(|e| anyhow::anyhow!(concat!($name, ": {}"), e))?;
        Ok(ToolResult::success(serde_json::to_string(&outcome.value)?))
    }};
}

/// List configured external task sources.
pub struct TaskSourceListTool {
    config: Arc<Config>,
}

impl TaskSourceListTool {
    pub fn new(config: Arc<Config>) -> Self {
        Self { config }
    }

View on GitHub (pinned to 7491200858)

Solutions

  1. Match FilterSpec's expected field names and types exactly (camelCase where applicable)
  2. Read the serde error {e} for the exact offending field
  3. Remove extra/unknown fields if the spec is strict
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/integrations/task_sources/tools.rs:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/2ae2a79154378626. Report an issue: GitHub.