{"record":{"id":"6c9efbb26ada74dd","repo":"tinyhumansai/openhuman","slug":"learning-rebuild-cache-rebuild-failed-e","errorCode":null,"errorMessage":"learning_rebuild_cache: rebuild failed: {e:#}","messagePattern":"learning_rebuild_cache: rebuild failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/learning/tools.rs","lineNumber":449,"sourceCode":"        json!({ \"type\": \"object\", \"properties\": {} })\n    }\n\n    fn permission_level(&self) -> PermissionLevel {\n        PermissionLevel::Execute\n    }\n\n    async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        log::debug!(\"[tool][learning] rebuild_cache invoked\");\n        let cache = get_cache().await?;\n        let detector = StabilityDetector::new(cache);\n        let now = SystemTime::now()\n            .duration_since(UNIX_EPOCH)\n            .map(|d| d.as_secs_f64())\n            .unwrap_or(0.0);\n        let outcome = detector\n            .rebuild(now)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"learning_rebuild_cache: rebuild failed: {e:#}\"))?;\n        Ok(ToolResult::success(serde_json::to_string(&json!({\n            \"added\": outcome.added,\n            \"evicted\": outcome.evicted,\n            \"kept\": outcome.kept,\n            \"total_size\": outcome.total_size,\n        }))?))\n    }\n}\n\n/// Reset the facet cache (delete all auto facets, keep pinned). Default-OFF.\npub struct LearningResetCacheTool;\n\n#[async_trait]\nimpl Tool for LearningResetCacheTool {\n    fn name(&self) -> &str {\n        \"learning_reset_cache\"\n    }\n","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/learning/tools.rs#L431-L467","documentation":"learning_rebuild_cache ran the StabilityDetector rebuild over all facets and it errored partway — a driver read/write failure during the recomputation of facet states. The cache is left in its pre-rebuild state.","triggerScenarios":"Thrown at src/openhuman/agent/learning/tools.rs:449 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the rebuild — it recomputes from current facet state and is idempotent","Check memory driver/module health in the error chain","Run learning_cache_stats afterwards to confirm the rebuilt state"],"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-23T08:17:48.524Z"}