Skip to content

Cloud upload and API routing don't support workspace selection #703

@groksrc

Description

@groksrc

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:

  1. 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
  2. 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
  3. 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_idconfig.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

  1. Have multiple workspaces (personal + teams)
  2. bm cloud workspace set-default <teams-tenant-id>
  3. bm project set-cloud myproject --workspace <teams-tenant-id>
  4. bm cloud upload ~/myproject --project myproject
  5. Files end up in personal workspace, not teams workspace

Environment

  • Basic Memory v0.20.3
  • Multiple cloud workspaces configured

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcloudBasic Memory Cloud

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions