{"record":{"id":"29ab80e3693939c6","repo":"tinyhumansai/openhuman","slug":"memory-unavailable-e","errorCode":null,"errorMessage":"memory unavailable: {e}","messagePattern":"memory unavailable: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/learning/tools.rs","lineNumber":36,"sourceCode":"use std::time::{SystemTime, UNIX_EPOCH};\n\nuse async_trait::async_trait;\nuse serde_json::json;\n\nuse crate::openhuman::agent::learning::cache::FacetCache;\nuse crate::openhuman::agent::learning::stability_detector::StabilityDetector;\nuse crate::openhuman::config::rpc as config_rpc;\nuse crate::openhuman::memory::api::provider::{FacetState, ProfileFacet, UserState};\nuse crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};\n\n/// Acquire the profile facet cache, mirroring `learning::schemas::get_cache`.\n///\n/// Goes through the bound driver: facets moved behind the memory module, so\n/// there is no process-global client to ask any more.\nasync fn get_cache() -> anyhow::Result<FacetCache> {\n    let guard = crate::openhuman::memory::ops::guard::active_memory_guard()\n        .await\n        .map_err(|e| anyhow::anyhow!(\"memory unavailable: {e}\"))?;\n    Ok(FacetCache::new(guard))\n}\n\n/// Compose the full facet key from a class string + key suffix.\nfn full_key(class_str: &str, key_suffix: &str) -> String {\n    format!(\"{class_str}/{key_suffix}\")\n}\n\nfn facet_to_json(f: &ProfileFacet) -> serde_json::Value {\n    serde_json::to_value(f).unwrap_or(serde_json::Value::Null)\n}\n\nfn read_required_str(args: &serde_json::Value, key: &str) -> anyhow::Result<String> {\n    args.get(key)\n        .and_then(serde_json::Value::as_str)\n        .map(str::trim)\n        .filter(|s| !s.is_empty())\n        .map(str::to_string)","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/learning/tools.rs#L18-L54","documentation":"Generic guard from the learning tools' get_cache(): acquiring the profile facet cache through the bound memory driver failed (driver unavailable, module not loaded, or capability unsupported). Every learning_* agent tool that needs facets fails with this wrapped error before doing any work.","triggerScenarios":"Thrown at src/openhuman/agent/learning/tools.rs:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check memory module/driver health and that profile facets are supported by the bound driver","Retry after the memory subsystem finishes initialising","Return a clean 'learning unavailable' tool error to the model instead of retrying in-turn"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}