tinyhumansai/openhuman · error
: facet not found
Error message
{tool}: facet not found: {fk} What it means
The pin/unpin helper's set_user_state returned Ok(false): no facet matched the composed class/key, so nothing was pinned or unpinned. Same shape as update_facet's not-found — the model referenced a facet key that does not exist.
Solutions
- List facets to find the correct class/key combination
- Fix typos in class or key suffix and retry
- Only pin facets surfaced earlier by learning_list_facets
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/openhuman/agent/learning/tools.rs:285 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/e7ae3770c064d96d.
Report an issue: GitHub.
Appendix: source
Thrown at src/openhuman/agent/learning/tools.rs:285
}
}
/// 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> {
let class_str = read_required_str(&args, "class")?;
let key_suffix = read_required_str(&args, "key")?;
let fk = full_key(&class_str, &key_suffix);
let cache = get_cache().await?;
let updated = cache
.set_user_state(&fk, state)
.await
.map_err(|e| anyhow::anyhow!("{tool}: set_user_state failed: {e:#}"))?;
if !updated {
return Err(anyhow::anyhow!("{tool}: facet not found: {fk}"));
}
let facet = cache
.get(&fk)
.await
.map_err(|e| anyhow::anyhow!("{tool}: re-read failed: {e:#}"))?;
Ok(ToolResult::success(serde_json::to_string(&json!({
"facet": facet.as_ref().map(facet_to_json),
}))?))
}
/// Pin a facet. Default-OFF.
pub struct LearningPinFacetTool;
#[async_trait]
impl Tool for LearningPinFacetTool {
fn name(&self) -> &str {
"learning_pin_facet"
}View on GitHub (pinned to 7491200858)