From 70d9460969e69ad14e4911635021660f30fc99a7 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 29 Oct 2025 19:13:04 -0700 Subject: [PATCH] fix: VFS not initialized during Excel import, causing 0 files accessible The VFSStructureGenerator.init() method tried to check if VFS was initialized by calling stat('/'), which would throw if uninitialized. However, this approach was unreliable. Changed to always call vfs.init() explicitly, which is safe since vfs.init() is idempotent. This fixes the critical bug where Excel imports completed successfully but no VFS files were accessible afterwards. Users would see 'VFS not initialized' errors when trying to query imported files. Tested with 567-row Excel file - VFS now properly shows imported directory structure with Characters/, Places/, Concepts/ subdirectories and metadata files. --- src/importers/VFSStructureGenerator.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/importers/VFSStructureGenerator.ts b/src/importers/VFSStructureGenerator.ts index 875d2c58..ca4e37f4 100644 --- a/src/importers/VFSStructureGenerator.ts +++ b/src/importers/VFSStructureGenerator.ts @@ -90,15 +90,10 @@ export class VFSStructureGenerator { // Get brain's cached VFS instance (creates if doesn't exist) this.vfs = this.brain.vfs() - // Initialize if not already initialized - // VFS.init() is idempotent (safe to call multiple times) - try { - // Check if already initialized - await this.vfs.stat('/') - } catch (error) { - // Not initialized, initialize now - await this.vfs.init() - } + // CRITICAL FIX (v4.10.2): Always call vfs.init() explicitly + // The previous code tried to check if initialized via stat('/') but this was unreliable + // vfs.init() is idempotent, so calling it multiple times is safe + await this.vfs.init() } /**