mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
fix: unify project path so path is always the local filesystem path
Cloud projects with bisync had a split-brain problem: `path` held a cloud slug while the actual local directory lived in `local_sync_path`. This caused `bm status` and file sync to fail for bisync'd cloud projects. Changes: - Config migration promotes `local_sync_path` → `path` for entries where `path` is a non-absolute cloud slug - `ensure_project_paths_exists` skips cloud-only projects with slug paths - `initialize_file_sync` and watch service now keep cloud projects that have an absolute local path (bisync copy) instead of skipping all cloud projects - `sync-setup` and `project add --cloud --local-path` set both `path` and `local_sync_path` to the local directory - `sync-setup` creates the project in the local DB for immediate MCP use - `_get_sync_project` falls back from `local_sync_path` to `path` - Config load errors now show user-friendly messages instead of stack traces Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
@@ -178,20 +178,19 @@ class WatchService:
|
||||
projects = await self.project_repository.get_active_projects()
|
||||
|
||||
# Trigger: project is configured for cloud routing
|
||||
# Why: cloud projects should not be watched/synced by local file watchers
|
||||
# Outcome: watch cycle only observes local-mode projects
|
||||
cloud_projects = [
|
||||
p.name
|
||||
for p in projects
|
||||
if self.app_config.get_project_mode(p.name) == ProjectMode.CLOUD
|
||||
]
|
||||
if cloud_projects:
|
||||
projects = [
|
||||
p
|
||||
for p in projects
|
||||
if self.app_config.get_project_mode(p.name) != ProjectMode.CLOUD
|
||||
]
|
||||
logger.debug(f"Skipping cloud-mode projects in watch cycle: {cloud_projects}")
|
||||
# Why: cloud-only projects (no local directory) should not be watched;
|
||||
# cloud projects with a local bisync copy (absolute path) need watching
|
||||
# Outcome: watch cycle skips cloud projects without a local directory
|
||||
cloud_skip = []
|
||||
for p in projects:
|
||||
if self.app_config.get_project_mode(p.name) == ProjectMode.CLOUD:
|
||||
entry = self.app_config.projects.get(p.name)
|
||||
if entry and Path(entry.path).is_absolute():
|
||||
continue # Cloud project with local bisync copy — keep watching
|
||||
cloud_skip.append(p.name)
|
||||
if cloud_skip:
|
||||
projects = [p for p in projects if p.name not in cloud_skip]
|
||||
logger.debug(f"Skipping cloud-mode projects in watch cycle: {cloud_skip}")
|
||||
|
||||
project_paths = [project.path for project in projects]
|
||||
logger.debug(f"Starting watch cycle for directories: {project_paths}")
|
||||
|
||||
Reference in New Issue
Block a user