Problem
When using Basic Memory Cloud with multiple workspaces (personal + teams), the bm cloud upload command and several cloud API utility functions don't route requests to the correct workspace. This makes it impossible to upload notes into a teams workspace via the CLI.
Root Cause
Three layers lack workspace support:
get_cloud_control_plane_client() in async_client.py — creates an HTTP client for WebDAV upload but doesn't accept or pass the X-Workspace-ID header
cloud_utils.py functions (fetch_cloud_projects, create_cloud_project, project_exists) — make API requests without workspace headers, so they always hit the user's personal workspace
get_client() per-project routing in async_client.py — when routing a cloud-mode project, doesn't resolve workspace_id from the project config entry or default_workspace
Impact
bm cloud upload always uploads to the personal workspace even when default_workspace or per-project workspace_id is configured
--create-project flag creates projects in the wrong workspace
- Post-upload database sync doesn't trigger in the correct workspace
Expected Behavior
bm cloud upload should resolve workspace from: per-project workspace_id → config.default_workspace → personal (fallback)
- All cloud API utility functions should pass
X-Workspace-ID header when a workspace is resolved
get_client() per-project routing should auto-resolve workspace from project config
Steps to Reproduce
- Have multiple workspaces (personal + teams)
bm cloud workspace set-default <teams-tenant-id>
bm project set-cloud myproject --workspace <teams-tenant-id>
bm cloud upload ~/myproject --project myproject
- Files end up in personal workspace, not teams workspace
Environment
- Basic Memory v0.20.3
- Multiple cloud workspaces configured
Problem
When using Basic Memory Cloud with multiple workspaces (personal + teams), the
bm cloud uploadcommand and several cloud API utility functions don't route requests to the correct workspace. This makes it impossible to upload notes into a teams workspace via the CLI.Root Cause
Three layers lack workspace support:
get_cloud_control_plane_client()inasync_client.py— creates an HTTP client for WebDAV upload but doesn't accept or pass theX-Workspace-IDheadercloud_utils.pyfunctions (fetch_cloud_projects,create_cloud_project,project_exists) — make API requests without workspace headers, so they always hit the user's personal workspaceget_client()per-project routing inasync_client.py— when routing a cloud-mode project, doesn't resolveworkspace_idfrom the project config entry ordefault_workspaceImpact
bm cloud uploadalways uploads to the personal workspace even whendefault_workspaceor per-projectworkspace_idis configured--create-projectflag creates projects in the wrong workspaceExpected Behavior
bm cloud uploadshould resolve workspace from: per-projectworkspace_id→config.default_workspace→ personal (fallback)X-Workspace-IDheader when a workspace is resolvedget_client()per-project routing should auto-resolve workspace from project configSteps to Reproduce
bm cloud workspace set-default <teams-tenant-id>bm project set-cloud myproject --workspace <teams-tenant-id>bm cloud upload ~/myproject --project myprojectEnvironment