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
Contact cloud only when config enables it; discovery ConnectTimeout stalls list_memory_projects #1810
Found during live testing of main at 0276799 (2026-10-22).
Problem
list_memory_projects took about 12.5s in local mode. It lists local projects first, then calls GET /workspaces/ on https://cloud.basicmemory.com because has_cloud_credentials(config) is true (an OAuth token exists and BASIC_MEMORY_API_KEY is set). That connect did not finish within the 10s connect timeout from _build_timeout(), so the tool fell back to the local list:
18:42:14.726 Creating HTTP client for cloud control plane at: https://cloud.basicmemory.com
18:42:27.250 WARNING Cloud workspace project index discovery failed while listing projects;
showing local-only project list: Request timed out (ConnectTimeout): the server did not
respond to GET '' in time. Long-running operations (such as deleting a large project)
may still be completing server-side ...
The failure was transient. The same discovery took 0.52s four minutes later.
Proposed behavior
Contact cloud only when the config enables cloud, not because credentials happen to exist. A stored OAuth token or an API key in the environment should not make local-only tool calls depend on cloud reachability. Cloud counts as enabled when, for example, a project has mode: cloud, cloud mode is on, or a workspace is configured. Pick one definition and use it everywhere has_cloud_credentials currently gates discovery: list_memory_projects, project resolution, and the unknown-project error path.
Also fix
The timeout message prints GET ''. _format_request_error in src/basic_memory/mcp/tools/utils.py uses url.split("/")[-1], which is empty for /workspaces/.
The same message suggests checking on a large project delete, which has nothing to do with a project list.
When cloud is enabled, optional discovery should use a short connect timeout so an unreachable cloud does not stall listing for 10s or more.
Component: MCP tools (list_memory_projects, project resolution), with cloud discovery behavior as the trigger
Priority: Medium. A transient cloud timeout makes a local-only call take 10s or more. Nothing is lost or broken, but any user with a stored OAuth token or BASIC_MEMORY_API_KEY is exposed to it.
Complexity: Medium. Three changes are involved:
Replace has_cloud_credentials(config) as the discovery gate with a single "cloud enabled by config" predicate. Apply it in list_memory_projects, project resolution and the unknown-project error path.
Fix _format_request_error in mcp/tools/utils.py. url.split("/")[-1] is empty for /workspaces/, so the message prints GET ''. The large-project-delete hint should also not appear on unrelated requests.
Give optional discovery a short connect timeout when cloud is enabled.
Duplicates: I found none. #834, #836 and #954 are closed and cover related routing problems. They are not about this credential gating or the discovery timeout.
Notes on the proposal:
The definition of "cloud enabled" (any project with mode: cloud, global cloud mode, or a configured workspace) needs to be one shared helper. It should have tests for each of the three triggers and for the credentials-only case, where no cloud call should be made.
Check that users who rely on API-key-only cloud access without mode: cloud still get workspace discovery, if that flow is supported.
Both timeout paths (enabled and unreachable, and the message formatting) need regression tests to hold the 100% coverage requirement.
Activity
claude commentedon Oct 23, 2026
Claude finished @phernandez's task in 18s —— View job
Triage
bug,cloud)list_memory_projects, project resolution), with cloud discovery behavior as the triggerBASIC_MEMORY_API_KEYis exposed to it.has_cloud_credentials(config)as the discovery gate with a single "cloud enabled by config" predicate. Apply it inlist_memory_projects, project resolution and the unknown-project error path._format_request_errorinmcp/tools/utils.py.url.split("/")[-1]is empty for/workspaces/, so the message printsGET ''. The large-project-delete hint should also not appear on unrelated requests.Duplicates: I found none. #834, #836 and #954 are closed and cover related routing problems. They are not about this credential gating or the discovery timeout.
Notes on the proposal:
mode: cloud, global cloud mode, or a configured workspace) needs to be one shared helper. It should have tests for each of the three triggers and for the credentials-only case, where no cloud call should be made.mode: cloudstill get workspace discovery, if that flow is supported.Triage only, so I made no code changes.
fix(mcp): shorten cloud discovery connects and fix timeout messages (b…