{"record":{"id":"0d408644fe1f03d3","repo":"tinyhumansai/openhuman","slug":"memory-forget-e","errorCode":null,"errorMessage":"memory_forget: {e}","messagePattern":"memory_forget: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/memory/tools/forget.rs","lineNumber":78,"sourceCode":"            .ok_or_else(|| anyhow::anyhow!(\"Missing 'key' parameter\"))?;\n\n        if let Err(error) = self\n            .security\n            .enforce_tool_operation(ToolOperation::Act, \"memory_forget\")\n        {\n            return Ok(ToolResult::error(error));\n        }\n\n        let namespace = namespace.trim();\n        let legacy_key = format!(\"{namespace}/{key}\");\n        let display_key = format!(\"{namespace}/{key}\");\n\n        // Try the new split namespace/key first (covers post-migration rows),\n        // then fall back to the legacy packed-key shape for rows that were\n        // stored before the boot migration ran (Phase A compatibility).\n        let guard = active_memory_guard()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"memory_forget: {e}\"))?;\n        let deleted = match guard.forget(namespace, key).await {\n            Ok(true) => true,\n            Ok(false) => match guard.forget(\"\", &legacy_key).await {\n                Ok(deleted) => deleted,\n                Err(e) => return Ok(ToolResult::error(format!(\"Failed to forget memory: {e}\"))),\n            },\n            Err(e) => return Ok(ToolResult::error(format!(\"Failed to forget memory: {e}\"))),\n        };\n\n        if deleted {\n            Ok(ToolResult::success(format!(\"Forgot memory: {display_key}\")))\n        } else {\n            Ok(ToolResult::success(format!(\n                \"No memory found with key: {display_key}\"\n            )))\n        }\n    }\n}","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/memory/tools/forget.rs#L60-L96","documentation":"Error-surfacing wrapper at the end of memory_forget's execute: the underlying store/driver delete (tried first as split namespace+key, then as the legacy packed `namespace/key` form) returned an error, which is re-wrapped with the memory_forget prefix. Unlike the parameter guards this fires after the Act-permission check passed, so the tool was authorized but the deletion itself failed (e.g. key not found is handled separately; this is a real store error).","triggerScenarios":"Thrown at src/openhuman/memory/tools/forget.rs:78 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the chained error: a missing row should be surfaced as not-found, not retried blindly","Retry on transient store locks or busy database errors","Verify the namespace/key combination exists with a recall first"],"exampleFix":null,"handlingStrategy":"retry","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"}