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
bm cloud login/logout don't reset default_workspace; no workspace picker on login #755
bm cloud logout followed by bm cloud login leaves config.default_workspace pointing at whatever tenant was previously selected. If a user had run bm cloud workspace set-default <some-org-tenant>, re-authentication keeps them stuck on that organization — even if they intended the re-login to return to their personal workspace. Additionally, bm cloud login performs no workspace selection step, so users with multiple workspaces can't change their default without a second explicit command.
Reproduction
bm cloud workspace set-default <org-tenant-id> (switch default to a Teams/org workspace)
bm cloud logout
bm cloud login
Inspect ~/.basic-memory/config.json → default_workspace is still the org tenant
bm project list → all cloud projects route to the org workspace, not the user's personal workspace
Expected
Either (or both):
bm cloud logout should clear default_workspace in config (since the session is being ended)
bm cloud login should detect multiple available workspaces and prompt the user to pick the default — similar to the existing workspace set-default interactive flow
The login-side prompt is the better UX: users with a single workspace shouldn't be prompted, but users with a personal + one-or-more org workspaces should get a chooser after the WorkOS OAuth handshake succeeds. This also gives first-time Teams members a clean on-ramp without needing to discover the workspace set-default subcommand.
Relevant code
src/basic_memory/cli/commands/cloud/core_commands.py — login() (no workspace selection), logout() (only clears tokens via auth.logout(), doesn't touch config.default_workspace)
src/basic_memory/cli/commands/cloud/workspace.py:108 — where config.default_workspace gets written via set_default_workspace. The existing interactive chooser there could be reused.
Context
Hit this while migrating a private project out of a Teams workspace back to a personal subscription. After re-auth, every bm command (and the MCP server wiring downstream) kept pointing at the org tenant, which was confusing — bm cloud status said "Cloud connected" with no hint that the active workspace was still the org. Manually running bm cloud workspace set-default <personal-tenant> fixed it.
logout() — now clears config.default_workspace = None and persists config after removing tokens. This prevents the stale workspace from silently routing to the wrong tenant on re-login.
login() — calls new _select_default_workspace_on_login() after successful authentication:
Single workspace: auto-set as default (no prompt needed)
Multiple workspaces: displays numbered list, prompts user to pick one (Enter = skip)
Discovery failure: non-fatal, prints guidance to use bm cloud workspace set-default
tests/cli/test_cloud_authentication.py
Added TestLogoutCommand and TestLoginWorkspaceSelection test classes covering:
Logout clears default_workspace when set
Logout is safe when default_workspace is already None
Login auto-sets single workspace
Login prompts and saves selection for multiple workspaces
Login skips without setting when user presses Enter
Activity
claude commentedon Apr 18, 2026
Claude finished @groksrc's task in 5m 18s —— View job •
claude/issue-755-20260418-0142• Create PR ➔Triage & Implementation
Classification: Bug + Enhancement | Component: Cloud/CLI | Complexity: Medium
core_commands.py,workspace.py,auth.py,project_context.py)bug,cloud,enhancement)logoutclearsdefault_workspaceloginprompts workspace selection when multiple workspaces existChanges Made
src/basic_memory/cli/commands/cloud/core_commands.pylogout()— now clearsconfig.default_workspace = Noneand persists config after removing tokens. This prevents the stale workspace from silently routing to the wrong tenant on re-login.login()— calls new_select_default_workspace_on_login()after successful authentication:bm cloud workspace set-defaulttests/cli/test_cloud_authentication.pyAdded
TestLogoutCommandandTestLoginWorkspaceSelectiontest classes covering:default_workspacewhen setdefault_workspaceis alreadyNone|
fix(cloud): reset default_workspace on logout; prompt workspace selec…