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
edit_note does not parse workspace-qualified permalinks when passed as the identifier parameter. Instead of routing to the correct workspace, it treats the full qualified permalink as a literal file path in the default (personal) workspace and creates a new note there.
Reproduction
Create a note in an org workspace — returns permalink like basic-memory-xxx/project/path/note-name
Call edit_note with that full permalink as the identifier:
This is the same class of bug as #799 (build_context workspace routing). read_note and delete_note correctly parse workspace-qualified permalinks, but edit_note does not.
Identify the workspace-qualified permalink parsing logic
Apply fix to edit_note
Add/update tests
Commit and push changes
Add labels and provide PR link
Root Cause
edit_note used detect_project_from_memory_url_prefix with an identifier.startswith("memory://") guard. This meant workspace-qualified plain permalinks (e.g. team-slug/project/path/note — no memory:// prefix) bypassed project detection entirely, so the call was routed to the default project. For append/prepend, when the note wasn't found there, a stray note was auto-created in the wrong workspace.
read_note already uses detect_project_from_identifier_prefix (no guard) which handles both memory:// URLs and workspace-qualified plain permalinks.
Changes
src/basic_memory/mcp/tools/edit_note.py:
Switched import from detect_project_from_memory_url_prefix → detect_project_from_identifier_prefix
Removed the startswith("memory://") guard — detection now runs for any identifier when no explicit project/project_id is provided (matches read_note)
Fixed auto-create fallback: use entity_identifier (workspace prefix already stripped by resolve_project_and_path) instead of the raw identifier for deriving the new note's title/directory
tests/mcp/test_tool_edit_note.py:
Updated 3 existing tests to reference detect_project_from_identifier_prefix
Added test_edit_note_workspace_qualified_plain_permalink_routes_correctly — mocks detect_project_from_identifier_prefix returning the correct project name (as cloud detection would in production) and verifies the edit succeeds in the right project
Activity
claude commentedon May 8, 2026
Claude finished @phernandez's task in 8m 58s —— View job •
claude/issue-810-20260508-2305• Create PR ➔Triage & Fix:
edit_noteworkspace-qualified permalink parsingType: Bug (MCP tool) | Priority: High | Complexity: Simple
edit_note,read_note,delete_noteimplementationedit_noteRoot Cause
edit_noteuseddetect_project_from_memory_url_prefixwith anidentifier.startswith("memory://")guard. This meant workspace-qualified plain permalinks (e.g.team-slug/project/path/note— nomemory://prefix) bypassed project detection entirely, so the call was routed to the default project. Forappend/prepend, when the note wasn't found there, a stray note was auto-created in the wrong workspace.read_notealready usesdetect_project_from_identifier_prefix(no guard) which handles bothmemory://URLs and workspace-qualified plain permalinks.Changes
src/basic_memory/mcp/tools/edit_note.py:detect_project_from_memory_url_prefix→detect_project_from_identifier_prefixstartswith("memory://")guard — detection now runs for any identifier when no explicitproject/project_idis provided (matchesread_note)entity_identifier(workspace prefix already stripped byresolve_project_and_path) instead of the rawidentifierfor deriving the new note's title/directorytests/mcp/test_tool_edit_note.py:detect_project_from_identifier_prefixtest_edit_note_workspace_qualified_plain_permalink_routes_correctly— mocksdetect_project_from_identifier_prefixreturning the correct project name (as cloud detection would in production) and verifies the edit succeeds in the right project