tinyhumansai/openhuman · error · anyhow::Error

missing required object argument `filter`

Error message

missing required object argument `filter`

What it means

parse_filter guard: the required 'filter' argument is missing entirely from the tool args, so there is no FilterSpec to deserialize. (A present-but-malformed filter produces the separate 'invalid filter' error.)

Source

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

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. Include a 'filter' object matching the FilterSpec schema in the tool call
  2. Copy the filter shape from the tool's JSON schema description
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/integrations/task_sources/tools.rs:55 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/71f3abe4bcb8752b. Report an issue: GitHub.