tinyhumansai/openhuman · error

learning_cache_stats: {e:#}

Error message

learning_cache_stats: {e:#}

What it means

Error "learning_cache_stats: {e:#}" thrown in tinyhumansai/openhuman.

Source

Thrown at src/openhuman/agent/learning/tools.rs:181

        "learning_cache_stats"
    }

    fn description(&self) -> &str {
        "Report facet-cache health: total facets, counts by state \
         (active/provisional/candidate/dropped), and a per-class breakdown of \
         active facets."
    }

    fn parameters_schema(&self) -> serde_json::Value {
        json!({ "type": "object", "properties": {} })
    }

    async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<ToolResult> {
        log::debug!("[tool][learning] cache_stats invoked");
        let cache = get_cache()?;
        let all = cache
            .list_all()
            .map_err(|e| anyhow::anyhow!("learning_cache_stats: {e:#}"))?;
        let count_state = |s: FacetState| all.iter().filter(|f| f.state == s).count();
        let mut by_class: std::collections::HashMap<String, usize> =
            std::collections::HashMap::new();
        for f in all.iter().filter(|f| f.state == FacetState::Active) {
            let cls = f
                .class
                .clone()
                .or_else(|| f.key.split('/').next().map(str::to_string))
                .unwrap_or_else(|| "unknown".to_string());
            *by_class.entry(cls).or_insert(0) += 1;
        }
        Ok(ToolResult::success(serde_json::to_string(&json!({
            "total": all.len(),
            "active": count_state(FacetState::Active),
            "provisional": count_state(FacetState::Provisional),
            "candidate": count_state(FacetState::Candidate),
            "dropped": count_state(FacetState::Dropped),
            "by_class": by_class,

View on GitHub (pinned to a221052e0d)

When it happens

Trigger: Thrown at src/openhuman/agent/learning/tools.rs:181 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/67a57e1098bf6460. Report an issue: GitHub.