tinyhumansai/openhuman · error

learning_cache_stats

Error message

learning_cache_stats: {e:#}

What it means

Error-surfacing wrapper in the learning cache_stats tool's execute (argument-free): get_cache() or cache.list_all() failed while collecting facet-cache health stats (total facets, state counts, per-class breakdown). Means the learning facet cache backend is unavailable or errored — an environment/driver problem, not bad input. `{e:#}` carries the alternate-form underlying error chain.

Solutions

  1. Check the memory driver/module health — the underlying error chain names the real failure
  2. Retry once for transient errors
  3. Use the platform health/doctor checks if the memory subsystem is persistently failing
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/openhuman/agent/learning/tools.rs:188 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/67a57e1098bf6460. Report an issue: GitHub.

Appendix: source

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

    }

    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().await?;
        let all = cache
            .list_all()
            .await
            .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 7491200858)