tinyhumansai/openhuman · error

learning_update_facet: facet not found: {fk}

Error message

learning_update_facet: facet not found: {fk}

What it means

learning_update_facet looked up the facet by its composed key (class/key-suffix) and the cache returned None — updates only modify existing facets, so an unknown class/key combination (or one the model invented) is rejected.

Source

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

        })
    }

    fn permission_level(&self) -> PermissionLevel {
        PermissionLevel::Write
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        log::debug!("[tool][learning] update_facet invoked");
        let class_str = read_required_str(&args, "class")?;
        let key_suffix = read_required_str(&args, "key")?;
        let value = read_required_str(&args, "value")?;
        let fk = full_key(&class_str, &key_suffix);
        let cache = get_cache().await?;
        let mut facet = cache
            .get(&fk)
            .await
            .map_err(|e| anyhow::anyhow!("learning_update_facet: {e:#}"))?
            .ok_or_else(|| anyhow::anyhow!("learning_update_facet: facet not found: {fk}"))?;
        facet.value = value;
        facet.user_state = UserState::Pinned;
        cache
            .upsert(&facet)
            .await
            .map_err(|e| anyhow::anyhow!("learning_update_facet: upsert failed: {e:#}"))?;
        Ok(ToolResult::success(serde_json::to_string(&json!({
            "facet": facet_to_json(&facet),
        }))?))
    }
}

/// Set/clear a facet's pin via `set_user_state`. Shared by pin/unpin.
async fn set_pin(
    args: serde_json::Value,
    tool: &str,
    state: UserState,
) -> anyhow::Result<ToolResult> {

View on GitHub (pinned to 7491200858)

Solutions

  1. List facets with learning_list_facets to find the correct class/key
  2. Create the facet through the normal learning/stability pipeline instead of update_facet if it does not exist
  3. Correct typos in the class or key suffix arguments and retry
Defensive patterns

Strategy: validation

When it happens

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