You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Data dir resolution hardcoded in several places — ignores BASIC_MEMORY_CONFIG_DIR #742
Several modules hardcode Path.home() / \".basic-memory\" to locate Basic Memory state instead of using BasicMemoryConfig.data_dir_path / ConfigManager.config_dir. This means they ignore the BASIC_MEMORY_CONFIG_DIR environment variable, which users/tests rely on to redirect Basic Memory state (for isolated worktrees, containerized runs, multi-instance setups, etc.).
Any feature accessed through these call sites will silently read/write the wrong directory when BASIC_MEMORY_CONFIG_DIR is set.
If a user runs with BASIC_MEMORY_CONFIG_DIR=/opt/bm-sandbox:
Config and the SQLite DB live under /opt/bm-sandbox/ (correct — honors the env var).
But the watch status file, log file, .bmignore, and rclone bisync state all end up under ~/.basic-memory/ (wrong).
This causes split state, stale watchers, log leakage across isolated instances, and broken .bmignore behavior depending on which code path the user hits first.
#741 introduces resolve_data_dir() as a module-level helper in config.py (the single source of truth, honoring BASIC_MEMORY_CONFIG_DIR).
This issue: update every call site above to use resolve_data_dir() (or an equivalent already-available config accessor) instead of hardcoding Path.home() / \".basic-memory\".
Add a regression test that exercises each of those code paths under a non-default BASIC_MEMORY_CONFIG_DIR and asserts the file/dir they touch lives under the redirected data dir.
Keeping it out of #741 to avoid scope creep on the FastEmbed cache fix.
Type: Bug (environment variable ignored in multiple code paths)
Priority: Medium — affects users and tests relying on BASIC_MEMORY_CONFIG_DIR to isolate Basic Memory state (containerized runs, CI, multi-instance setups). No data loss, but causes split state and subtle misbehavior.
Component: Cross-cutting — sync, services, cli/cloud, plus utils and ignore_utils
Complexity: Medium — 5 known call sites to update plus regression tests, but each fix is mechanical
The fix is already partially designed: BasicMemoryConfig.data_dir_path (line 710 in config.py) and ConfigManager.config_dir (line 742) both honor BASIC_MEMORY_CONFIG_DIR. The issue mentions that #741 will introduce a module-level resolve_data_dir() helper — but that helper doesn't exist yet.
Option A: Wait for #741 to land, then use resolve_data_dir() at each call site.
Option B: Add resolve_data_dir() directly in this PR (it's a one-liner that mirrors BasicMemoryConfig.data_dir_path) and update all 5 call sites.
For sites that already have access to app_config (e.g., watch_service.py receives BasicMemoryConfig), use app_config.data_dir_path directly. For standalone helpers (utils.py, ignore_utils.py, rclone_commands.py), a module-level resolve_data_dir() is cleaner.
No Duplicate Found
Searched open issues — this is a distinct follow-up to #741 as noted by the author.
Activity
claude commentedon Apr 15, 2026
Claude finished @groksrc's task in 1m 37s —— View job
Issue Triage
bugapplied)Analysis
Type: Bug (environment variable ignored in multiple code paths)
Priority: Medium — affects users and tests relying on
BASIC_MEMORY_CONFIG_DIRto isolate Basic Memory state (containerized runs, CI, multi-instance setups). No data loss, but causes split state and subtle misbehavior.Component: Cross-cutting —
sync,services,cli/cloud, plusutilsandignore_utilsComplexity: Medium — 5 known call sites to update plus regression tests, but each fix is mechanical
Verified Call Sites
All 5 hardcoded paths confirmed in the codebase:
src/basic_memory/utils.pyPath.home() / ".basic-memory" / log_filenamesrc/basic_memory/ignore_utils.pyPath.home() / ".basic-memory" / ".bmignore"src/basic_memory/sync/watch_service.pyPath.home() / ".basic-memory" / WATCH_STATUS_JSONsrc/basic_memory/services/project_service.pyPath.home() / ".basic-memory" / WATCH_STATUS_JSONsrc/basic_memory/cli/commands/cloud/rclone_commands.pyPath.home() / ".basic-memory" / "bisync-state" / project_nameProposed Fix
The fix is already partially designed:
BasicMemoryConfig.data_dir_path(line 710 inconfig.py) andConfigManager.config_dir(line 742) both honorBASIC_MEMORY_CONFIG_DIR. The issue mentions that #741 will introduce a module-levelresolve_data_dir()helper — but that helper doesn't exist yet.Option A: Wait for #741 to land, then use
resolve_data_dir()at each call site.Option B: Add
resolve_data_dir()directly in this PR (it's a one-liner that mirrorsBasicMemoryConfig.data_dir_path) and update all 5 call sites.For sites that already have access to
app_config(e.g.,watch_service.pyreceivesBasicMemoryConfig), useapp_config.data_dir_pathdirectly. For standalone helpers (utils.py,ignore_utils.py,rclone_commands.py), a module-levelresolve_data_dir()is cleaner.No Duplicate Found
Searched open issues — this is a distinct follow-up to #741 as noted by the author.
fix(core): honor BASIC_MEMORY_CONFIG_DIR across remaining call sites
fix(core): honor BASIC_MEMORY_CONFIG_DIR across remaining call sites