Repository navigation
Description
Summary
When a project name is ambiguous across workspaces, resolve_workspace_project_identifier raises an error that tells the caller to retry using the qualified workspace_slug/project_name form. But when the model follows that hint, the retry fails with Project not found: '<qualified_name>'. The hint and the API are out of sync.
Reproduction (from a Claude Web session)
Account has two workspaces, each with a project named main.
- Model calls
search_notes(project="main", query="openclaw runbook") - Error from
src/basic_memory/mcp/project_context.py:648:Project 'main' exists in multiple workspaces. Use: personal/main or basic-memory-7020de4e925843c68c9056c60d101d9e/main - Personal (personal): personal/main - Basic Memory (basic-memory-7020de4e925843c68c9056c60d101d9e): basic-memory-7020de4e925843c68c9056c60d101d9e/main - Model follows the hint:
search_notes(project="personal/main", query="openclaw runbook") - Error:
Project not found: 'personal/main'(fromsrc/basic_memory/api/v2/routers/project_router.py:274)
Root cause
- The error message uses
WorkspaceProjectEntry.qualified_name(=workspace.slug + "/" + project.permalink) for both options it shows. get_project_client→get_active_projectPOSTs{"identifier": "personal/main"}to/v2/projects/resolve.- That endpoint only attempts: external_id (UUID) → permalink → case-insensitive name. It never splits on
/to peel off a workspace slug, so the qualified form 404s.
Expected
Either:
- Make the hint accurate — only suggest forms the API actually accepts (e.g., the workspace UUID alone, or instructions to use the
project_id/workspaceparameters), or - Make the API accept the form the hint suggests —
/v2/projects/resolve(and the upstreamget_project_client→get_active_projectpath) should split<workspace_slug>/<project>and route to the right workspace before resolving.
Option 2 seems closer to user expectation since resolve_workspace_project_identifier itself already parses the qualified form correctly via _split_qualified_project_identifier. The break is downstream when project_for_api flows back into get_active_project without the workspace context being preserved across the round-trip.
Why this matters
Models follow the error hint verbatim, then loop on a confusing second error. Related to #783 (workspace disambiguation) and #756 (cross-workspace MCP routing), but distinct: those tracked the data model; this is the user-/agent-facing API contract for the disambiguation hint.
Screenshot

Activity
claude commentedon May 5, 2026
Claude finished @groksrc's task in 2m 29s —— View job
Issue Triage: #793
Classification
Labels applied:
bug,cloudRoot Cause Confirmed
I traced the code and confirmed the bug. The error at
project_context.py:796–798produces:This is generated by
_format_qualified_choices(matches)usingWorkspaceProjectEntry.qualified_name(=workspace.slug + "/" + project.permalink).When the model retries with
project="personal/main", two paths can fail:Local ASGI routing (
project_context.py:1413):get_active_projectis called withresolved_project = "personal/main"and POSTs{"identifier": "personal/main"}to/v2/projects/resolve, which only tries UUID → permalink → case-insensitive name. It never splits on/, so it 404s.Cloud routing
project_for_apiinit (project_context.py:1356):_unqualified_project_identifier("personal/main")correctly strips to"main", but this only matters whenresolve_workspace_project_identifieris also called and succeeds. If a project entry is found in local config byworkspace_id(lines 1358–1361),project_for_apistays as the stripped "main" from line 1356 — that path is fine. The problem is only when local routing is used.The
resolve_workspace_project_identifierfunction (project_context.py:711–760) correctly handles theworkspace_slug/project_namesplit — so the fix is either:external_id)./v2/projects/resolve— add workspace-prefix parsing: splitworkspace_slug/project_name, look up the workspace by slug, then resolve the project within it. This is the cleaner UX fix.get_active_projectatproject_context.py:1413strips the workspace prefix before posting to/v2/projects/resolve, similar to how the cloud routing path uses_unqualified_project_identifier.Option 3 is the minimal defensive fix (strip the qualifier before hitting the API in local routing). Option 2 makes the API robust to the hint's suggestion. Option 1 is also viable but degrades the UX.
The issue author correctly notes that
resolve_workspace_project_identifieralready has all the logic needed — the break is that the resolvedWorkspaceProjectEntrycontext isn't preserved when the routing falls through to the local ASGIget_active_projectcall.Related Issues
No exact duplicate found.