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
MCP project listing attaches local state to same-name Team workspace projects #848
list_memory_projects merges local project metadata into cloud projects by project permalink only. When two cloud workspaces contain projects with the same permalink, a local project with that permalink can be reported as attached to the wrong workspace project.
This is especially misleading for Team/organization workspaces, where local rclone bisync is not supported. A Team workspace project can appear as local+cloud and show a local path even though it should be cloud-only.
Steps to Reproduce
Configure a local project named main.
Authenticate with cloud access to multiple workspaces.
Ensure both a Personal workspace and a Team/organization workspace contain a cloud project whose permalink is main.
Call the MCP project listing tool, e.g. list_memory_projects / Hermes bm_projects().
Inspect the Team/organization workspace main project entry.
Expected Behavior
Local metadata should be attached only to the cloud workspace/project that actually owns the local config state.
For a same-name Team/organization workspace project, the MCP listing should report something equivalent to:
The Team/organization workspace project can be reported as local+cloud and include the local path for the unrelated local project with the same permalink.
Likely Root Cause
src/basic_memory/mcp/tools/project_management.py::_merge_workspace_projects() indexes local projects by permalink:
local_by_permalink[project.permalink] =project
Then every cloud workspace project with that permalink gets merged with the local project:
The CLI project listing has more careful "attached row" logic and does not show local/sync state on Team workspace rows. The MCP project listing should use the same ownership model.
Notes
No personal paths, tenant IDs, or project IDs are required to reproduce this; the key condition is duplicate project permalinks across workspaces plus a local project with the same permalink.
Priority: Medium — incorrect data shown in MCP project listing; affects users with multiple cloud workspaces containing same-name projects
Component: MCP tools, cloud functionality
Complexity: Medium
Root cause confirmed:_merge_workspace_projects() in project_management.py:139 indexes local projects by permalink only, so every cloud workspace project sharing a permalink incorrectly receives the local metadata. The CLI (project.py:511) has a _select_attached_row_key() that selects exactly ONE row per permalink to own local state — the MCP tool now uses the same model.
Analyze issue and gather context
Read source files (project_management.py and CLI equivalent)
Triage: classify, prioritize, label
Implement fix: add _select_attached_cloud_entry() and update _merge_workspace_projects()
Add tests (8 new tests for duplicate-permalink cross-workspace scenario)
Run tests (just fast-check) — requires push to CI
Commit signed (DCO)
Push to remote — blocked: github-actions[bot] lacks push permission to this repo
Changes Made
src/basic_memory/mcp/tools/project_management.py
Added _select_attached_cloud_entry() helper that mirrors the CLI ownership model:
Per-project config.workspace_id (set via bm project set-cloud --workspace)
Global config.default_workspace
The workspace flagged is_default by the cloud (typically Personal)
Personal workspace over team/organization
Alphabetical tiebreak
Updated _merge_workspace_projects() to group cloud entries by permalink, select the single "attached" entry per local project via the helper, and only merge local_path / source: "local+cloud" into that one entry. All other workspace rows with the same permalink remain source: "cloud" with local_path: null.
Updated call site to pass config so workspace ownership can be resolved.
tests/mcp/test_tool_project_management.py
Added 8 unit tests covering: empty/single candidate handling, each ownership priority level, the primary regression scenario (team workspace stays cloud-only), and the config-workspace-wins scenario.
Push Failure
The push was blocked with Permission to basicmachines-co/basic-memory.git denied to github-actions[bot]. The commit is ready locally on branch claude/issue-848-20260524-1511 but cannot be pushed without write access. A maintainer can cherry-pick or push the commit manually.
Activity
claude commentedon May 24, 2026
Claude finished @groksrc's task in 5m 41s —— View job
Triage & Fix
Triage:
Root cause confirmed:
_merge_workspace_projects()inproject_management.py:139indexes local projects by permalink only, so every cloud workspace project sharing a permalink incorrectly receives the local metadata. The CLI (project.py:511) has a_select_attached_row_key()that selects exactly ONE row per permalink to own local state — the MCP tool now uses the same model.project_management.pyand CLI equivalent)_select_attached_cloud_entry()and update_merge_workspace_projects()just fast-check) — requires push to CIgithub-actions[bot]lacks push permission to this repoChanges Made
src/basic_memory/mcp/tools/project_management.pyAdded
_select_attached_cloud_entry()helper that mirrors the CLI ownership model:config.workspace_id(set viabm project set-cloud --workspace)config.default_workspaceis_defaultby the cloud (typically Personal)Updated
_merge_workspace_projects()to group cloud entries by permalink, select the single "attached" entry per local project via the helper, and only mergelocal_path/source: "local+cloud"into that one entry. All other workspace rows with the same permalink remainsource: "cloud"withlocal_path: null.Updated call site to pass
configso workspace ownership can be resolved.tests/mcp/test_tool_project_management.pyAdded 8 unit tests covering: empty/single candidate handling, each ownership priority level, the primary regression scenario (team workspace stays
cloud-only), and the config-workspace-wins scenario.Push Failure
The push was blocked with
Permission to basicmachines-co/basic-memory.git denied to github-actions[bot]. The commit is ready locally on branchclaude/issue-848-20260524-1511but cannot be pushed without write access. A maintainer can cherry-pick or push the commit manually.phernandez commentedon May 24, 2026
I was thinking we may have to do something with permalinks like the web-v2 does:
cloud | workspace | project | pathtest(mcp): port project management tests to bm_project (#1961)